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

Side by Side Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 10827198: Change View::HitTest to View::HitTestRect (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed errors reported by trybots Created 8 years, 4 months 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
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.h ('k') | ui/app_list/app_list_item_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/toolbar_view.h" 5 #include "chrome/browser/ui/views/toolbar_view.h"
6 6
7 #include "base/i18n/number_formatting.h" 7 #include "base/i18n/number_formatting.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/command_updater.h" 10 #include "chrome/browser/command_updater.h"
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 browser_actions_->Layout(); 756 browser_actions_->Layout();
757 757
758 // Extend the app menu to the screen's right edge in maximized mode just like 758 // Extend the app menu to the screen's right edge in maximized mode just like
759 // we extend the back button to the left edge. 759 // we extend the back button to the left edge.
760 if (maximized) 760 if (maximized)
761 app_menu_width += kRightEdgeSpacing; 761 app_menu_width += kRightEdgeSpacing;
762 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y, 762 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y,
763 app_menu_width, child_height); 763 app_menu_width, child_height);
764 } 764 }
765 765
766 bool ToolbarView::HitTest(const gfx::Point& point) const { 766 bool ToolbarView::HitTestRect(const gfx::Rect& rect) const {
767 // Don't take hits in our top shadow edge. Let them fall through to the 767 // Don't take hits in our top shadow edge. Let them fall through to the
768 // tab strip above us. 768 // tab strip above us.
769 if (point.y() < kContentShadowHeight) 769 if (rect.y() < kContentShadowHeight)
770 return false; 770 return false;
771 // Otherwise let our superclass take care of it. 771 // Otherwise let our superclass take care of it.
772 return AccessiblePaneView::HitTest(point); 772 return AccessiblePaneView::HitTestRect(rect);
773 } 773 }
774 774
775 void ToolbarView::OnPaint(gfx::Canvas* canvas) { 775 void ToolbarView::OnPaint(gfx::Canvas* canvas) {
776 View::OnPaint(canvas); 776 View::OnPaint(canvas);
777 777
778 if (is_display_mode_normal()) 778 if (is_display_mode_normal())
779 return; 779 return;
780 780
781 // In maximized mode, we don't draw the endcaps on the location bar, because 781 // In maximized mode, we don't draw the endcaps on the location bar, because
782 // when they're flush against the edge of the screen they just look glitchy. 782 // when they're flush against the edge of the screen they just look glitchy.
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 // LocationBarContainer is not a child of the ToolbarView. 1012 // LocationBarContainer is not a child of the ToolbarView.
1013 gfx::Point origin(bounds.origin()); 1013 gfx::Point origin(bounds.origin());
1014 views::View::ConvertPointToView(this, location_bar_container_->parent(), 1014 views::View::ConvertPointToView(this, location_bar_container_->parent(),
1015 &origin); 1015 &origin);
1016 gfx::Rect target_bounds(origin, bounds.size()); 1016 gfx::Rect target_bounds(origin, bounds.size());
1017 if (location_bar_container_->GetTargetBounds() != target_bounds) { 1017 if (location_bar_container_->GetTargetBounds() != target_bounds) {
1018 location_bar_container_->SetInToolbar(true); 1018 location_bar_container_->SetInToolbar(true);
1019 location_bar_container_->SetBoundsRect(target_bounds); 1019 location_bar_container_->SetBoundsRect(target_bounds);
1020 } 1020 }
1021 } 1021 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.h ('k') | ui/app_list/app_list_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698