1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/ui/views/find_bar_host.h" 6 7 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 9 #include "chrome/browser/ui/views/frame/browser_view.h" 10 #include "content/browser/tab_contents/tab_contents.h" 11 #include "content/browser/tab_contents/tab_contents_view.h" 12 #include "views/widget/widget_gtk.h" 13 AudibleAlert()14void FindBarHost::AudibleAlert() { 15 // TODO(davemoore) implement. 16 NOTIMPLEMENTED(); 17 } 18 GetWidgetPositionNative(gfx::Rect * avoid_overlapping_rect)19void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { 20 gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowScreenBounds(); 21 TabContentsView* tab_view = find_bar_controller_->tab_contents()->view(); 22 gfx::Rect webcontents_rect; 23 tab_view->GetViewBounds(&webcontents_rect); 24 avoid_overlapping_rect->Offset(0, webcontents_rect.y() - frame_rect.y()); 25 } 26 ShouldForwardKeyEventToWebpageNative(const views::KeyEvent & key_event)27bool FindBarHost::ShouldForwardKeyEventToWebpageNative( 28 const views::KeyEvent& key_event) { 29 return true; 30 } 31