| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // This is tricky due to asynchronous nature of x11. | 213 // This is tricky due to asynchronous nature of x11. |
| 214 // See bug http://crbug.com/28629. | 214 // See bug http://crbug.com/28629. |
| 215 #endif | 215 #endif |
| 216 if (position) | 216 if (position) |
| 217 *position = gfx::Point(); | 217 *position = gfx::Point(); |
| 218 if (fully_visible) | 218 if (fully_visible) |
| 219 *fully_visible = false; | 219 *fully_visible = false; |
| 220 return false; | 220 return false; |
| 221 } | 221 } |
| 222 | 222 |
| 223 gfx::Rect window_rect = host()->GetWindowScreenBounds(); | 223 gfx::Rect window_rect = host()->GetWindowBoundsInScreen(); |
| 224 if (position) | 224 if (position) |
| 225 *position = window_rect.origin(); | 225 *position = window_rect.origin(); |
| 226 if (fully_visible) | 226 if (fully_visible) |
| 227 *fully_visible = IsVisible() && !IsAnimating(); | 227 *fully_visible = IsVisible() && !IsAnimating(); |
| 228 return true; | 228 return true; |
| 229 } | 229 } |
| 230 | 230 |
| 231 string16 FindBarHost::GetFindText() { | 231 string16 FindBarHost::GetFindText() { |
| 232 return find_bar_view()->GetFindText(); | 232 return find_bar_view()->GetFindText(); |
| 233 } | 233 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 ui::Accelerator escape(ui::VKEY_RETURN, ui::EF_CONTROL_DOWN); | 324 ui::Accelerator escape(ui::VKEY_RETURN, ui::EF_CONTROL_DOWN); |
| 325 focus_manager()->UnregisterAccelerator(escape, this); | 325 focus_manager()->UnregisterAccelerator(escape, this); |
| 326 | 326 |
| 327 DropdownBarHost::UnregisterAccelerators(); | 327 DropdownBarHost::UnregisterAccelerators(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 //////////////////////////////////////////////////////////////////////////////// | 330 //////////////////////////////////////////////////////////////////////////////// |
| 331 // private: | 331 // private: |
| 332 | 332 |
| 333 void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { | 333 void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { |
| 334 gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowScreenBounds(); | 334 gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowBoundsInScreen(); |
| 335 content::WebContentsView* tab_view = | 335 content::WebContentsView* tab_view = |
| 336 find_bar_controller_->tab_contents()->web_contents()->GetView(); | 336 find_bar_controller_->tab_contents()->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 |