| 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 <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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 // Unregister Ctrl+Return. | 310 // Unregister Ctrl+Return. |
| 311 ui::Accelerator escape(ui::VKEY_RETURN, false, true, false); | 311 ui::Accelerator escape(ui::VKEY_RETURN, false, true, false); |
| 312 focus_manager()->UnregisterAccelerator(escape, this); | 312 focus_manager()->UnregisterAccelerator(escape, this); |
| 313 | 313 |
| 314 DropdownBarHost::UnregisterAccelerators(); | 314 DropdownBarHost::UnregisterAccelerators(); |
| 315 } | 315 } |
| 316 | 316 |
| 317 //////////////////////////////////////////////////////////////////////////////// | 317 //////////////////////////////////////////////////////////////////////////////// |
| 318 // private: | 318 // private: |
| 319 | 319 |
| 320 void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { |
| 321 gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowScreenBounds(); |
| 322 TabContentsView* tab_view = find_bar_controller_->tab_contents()->view(); |
| 323 gfx::Rect webcontents_rect; |
| 324 tab_view->GetViewBounds(&webcontents_rect); |
| 325 avoid_overlapping_rect->Offset(0, webcontents_rect.y() - frame_rect.y()); |
| 326 } |
| 327 |
| 320 FindBarView* FindBarHost::find_bar_view() { | 328 FindBarView* FindBarHost::find_bar_view() { |
| 321 return static_cast<FindBarView*>(view()); | 329 return static_cast<FindBarView*>(view()); |
| 322 } | 330 } |
| OLD | NEW |