OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
10 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 10 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 ResetFocusTracker(); | 152 ResetFocusTracker(); |
153 } | 153 } |
154 | 154 |
155 bool FindBarHost::IsFindBarVisible() { | 155 bool FindBarHost::IsFindBarVisible() { |
156 return DropdownBarHost::IsVisible(); | 156 return DropdownBarHost::IsVisible(); |
157 } | 157 } |
158 | 158 |
159 void FindBarHost::RestoreSavedFocus() { | 159 void FindBarHost::RestoreSavedFocus() { |
160 if (focus_tracker() == NULL) { | 160 if (focus_tracker() == NULL) { |
161 // TODO(brettw): Focus() should be on WebContentsView. | 161 // TODO(brettw): Focus() should be on WebContentsView. |
162 find_bar_controller_->web_contents()->Focus(); | 162 find_bar_controller_->web_contents()->GetView()->Focus(); |
163 } else { | 163 } else { |
164 focus_tracker()->FocusLastFocusedExternalView(); | 164 focus_tracker()->FocusLastFocusedExternalView(); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 FindBarTesting* FindBarHost::GetFindBarTesting() { | 168 FindBarTesting* FindBarHost::GetFindBarTesting() { |
169 return this; | 169 return this; |
170 } | 170 } |
171 | 171 |
172 //////////////////////////////////////////////////////////////////////////////// | 172 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowBoundsInScreen(); | 334 gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowBoundsInScreen(); |
335 content::WebContentsView* tab_view = | 335 content::WebContentsView* tab_view = |
336 find_bar_controller_->web_contents()->GetView(); | 336 find_bar_controller_->web_contents()->GetView(); |
337 gfx::Rect webcontents_rect = tab_view->GetViewBounds(); | 337 gfx::Rect webcontents_rect = tab_view->GetViewBounds(); |
338 avoid_overlapping_rect->Offset(0, webcontents_rect.y() - frame_rect.y()); | 338 avoid_overlapping_rect->Offset(0, webcontents_rect.y() - frame_rect.y()); |
339 } | 339 } |
340 | 340 |
341 FindBarView* FindBarHost::find_bar_view() { | 341 FindBarView* FindBarHost::find_bar_view() { |
342 return static_cast<FindBarView*>(view()); | 342 return static_cast<FindBarView*>(view()); |
343 } | 343 } |
OLD | NEW |