Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Side by Side Diff: chrome/browser/views/find_bar_win.cc

Issue 13235: Cleanup adding BoundsInWidget to View to convert callers... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/views/hwnd_view.cc » ('j') | chrome/views/view.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/find_bar_win.h" 5 #include "chrome/browser/views/find_bar_win.h"
6 6
7 #include "chrome/browser/browser.h" 7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/find_notification_details.h" 9 #include "chrome/browser/find_notification_details.h"
10 #include "chrome/browser/render_view_host.h" 10 #include "chrome/browser/render_view_host.h"
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 *bounds = gfx::Rect(browser_client_rect); 480 *bounds = gfx::Rect(browser_client_rect);
481 481
482 // Find the dimensions of the toolbar and the BookmarkBar. 482 // Find the dimensions of the toolbar and the BookmarkBar.
483 gfx::Rect toolbar_bounds, bookmark_bar_bounds; 483 gfx::Rect toolbar_bounds, bookmark_bar_bounds;
484 if (toolbar) { 484 if (toolbar) {
485 toolbar_bounds = toolbar->GetLocalBounds(false); 485 toolbar_bounds = toolbar->GetLocalBounds(false);
486 // Need to convert toolbar bounds into Widget coords because the toolbar 486 // Need to convert toolbar bounds into Widget coords because the toolbar
487 // is the child of another view that isn't the top level view. This is 487 // is the child of another view that isn't the top level view. This is
488 // required to ensure correct positioning relative to the top,left of the 488 // required to ensure correct positioning relative to the top,left of the
489 // window. 489 // window.
490 gfx::Point topleft; 490 gfx::Rect widget_bounds = toolbar->BoundsInWidget();
491 views::View::ConvertPointToWidget(toolbar, &topleft); 491 toolbar_bounds.Offset(widget_bounds.x(), widget_bounds.y());
492 toolbar_bounds.Offset(topleft.x(), topleft.y());
493 } 492 }
494 493
495 // If the bookmarks bar is available, we need to update our 494 // If the bookmarks bar is available, we need to update our
496 // position and paint accordingly 495 // position and paint accordingly
497 if (bookmark_bar) { 496 if (bookmark_bar) {
498 if (bookmark_bar->IsAlwaysShown()) { 497 if (bookmark_bar->IsAlwaysShown()) {
499 // If it's always on, don't try to blend with the toolbar. 498 // If it's always on, don't try to blend with the toolbar.
500 view_->SetToolbarBlend(false); 499 view_->SetToolbarBlend(false);
501 } else { 500 } else {
502 // Else it's on, but hidden (in which case we should try 501 // Else it's on, but hidden (in which case we should try
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 // TODO(finnur): Once we fix issue 1307173 we should not remember any old 678 // TODO(finnur): Once we fix issue 1307173 we should not remember any old
680 // accelerator targets and just Register and Unregister when needed. 679 // accelerator targets and just Register and Unregister when needed.
681 DCHECK(old_accel_target_for_esc_ != NULL); 680 DCHECK(old_accel_target_for_esc_ != NULL);
682 views::Accelerator escape(VK_ESCAPE, false, false, false); 681 views::Accelerator escape(VK_ESCAPE, false, false, false);
683 views::AcceleratorTarget* current_target = 682 views::AcceleratorTarget* current_target =
684 focus_manager_->GetTargetForAccelerator(escape); 683 focus_manager_->GetTargetForAccelerator(escape);
685 if (current_target == this) 684 if (current_target == this)
686 focus_manager_->RegisterAccelerator(escape, old_accel_target_for_esc_); 685 focus_manager_->RegisterAccelerator(escape, old_accel_target_for_esc_);
687 } 686 }
688 687
OLDNEW
« no previous file with comments | « no previous file | chrome/views/hwnd_view.cc » ('j') | chrome/views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698