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