| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 //////////////////////////////////////////////////////////////////////////////// | 359 //////////////////////////////////////////////////////////////////////////////// |
| 360 // private: | 360 // private: |
| 361 | 361 |
| 362 void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { | 362 void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { |
| 363 gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowBoundsInScreen(); | 363 gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowBoundsInScreen(); |
| 364 gfx::Rect webcontents_rect = | 364 gfx::Rect webcontents_rect = |
| 365 find_bar_controller_->web_contents()->GetViewBounds(); | 365 find_bar_controller_->web_contents()->GetViewBounds(); |
| 366 avoid_overlapping_rect->Offset(0, webcontents_rect.y() - frame_rect.y()); | 366 avoid_overlapping_rect->Offset(0, webcontents_rect.y() - frame_rect.y()); |
| 367 } | 367 } |
| 368 |
| 369 void FindBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, |
| 370 bool no_redraw) { |
| 371 if (!host()->IsVisible()) |
| 372 host()->Show(); |
| 373 host()->SetBounds(new_pos); |
| 374 } |
| OLD | NEW |