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

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: 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
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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 browser_actions_->Layout(); 758 browser_actions_->Layout();
759 759
760 // Extend the app menu to the screen's right edge in maximized mode just like 760 // Extend the app menu to the screen's right edge in maximized mode just like
761 // we extend the back button to the left edge. 761 // we extend the back button to the left edge.
762 if (maximized) 762 if (maximized)
763 app_menu_width += kRightEdgeSpacing; 763 app_menu_width += kRightEdgeSpacing;
764 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y, 764 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y,
765 app_menu_width, child_height); 765 app_menu_width, child_height);
766 } 766 }
767 767
768 bool ToolbarView::HitTest(const gfx::Point& point) const { 768 bool ToolbarView::HitTest(const gfx::Rect& rect) const {
769 // Don't take hits in our top shadow edge. Let them fall through to the 769 // Don't take hits in our top shadow edge. Let them fall through to the
770 // tab strip above us. 770 // tab strip above us.
771 if (point.y() < kContentShadowHeight) 771 fprintf(stderr, "in toolbar_view\n");
772 if (rect.y() < kContentShadowHeight) {
tdanderson 2012/08/07 16:18:28 Should this instead be rect.y() + rect.height() ?
sky 2012/08/07 20:11:43 I think this one wants want like you have.
tdanderson 2012/08/08 23:47:51 Ok, I left this alone.
772 return false; 773 return false;
774 }
773 // Otherwise let our superclass take care of it. 775 // Otherwise let our superclass take care of it.
774 return AccessiblePaneView::HitTest(point); 776 return AccessiblePaneView::HitTest(rect);
775 } 777 }
776 778
777 void ToolbarView::OnPaint(gfx::Canvas* canvas) { 779 void ToolbarView::OnPaint(gfx::Canvas* canvas) {
778 View::OnPaint(canvas); 780 View::OnPaint(canvas);
779 781
780 if (is_display_mode_normal()) 782 if (is_display_mode_normal())
781 return; 783 return;
782 784
783 // In maximized mode, we don't draw the endcaps on the location bar, because 785 // In maximized mode, we don't draw the endcaps on the location bar, because
784 // when they're flush against the edge of the screen they just look glitchy. 786 // 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
1014 // LocationBarContainer is not a child of the ToolbarView. 1016 // LocationBarContainer is not a child of the ToolbarView.
1015 gfx::Point origin(bounds.origin()); 1017 gfx::Point origin(bounds.origin());
1016 views::View::ConvertPointToView(this, location_bar_container_->parent(), 1018 views::View::ConvertPointToView(this, location_bar_container_->parent(),
1017 &origin); 1019 &origin);
1018 gfx::Rect target_bounds(origin, bounds.size()); 1020 gfx::Rect target_bounds(origin, bounds.size());
1019 if (location_bar_container_->GetTargetBounds() != target_bounds) { 1021 if (location_bar_container_->GetTargetBounds() != target_bounds) {
1020 location_bar_container_->SetInToolbar(true); 1022 location_bar_container_->SetInToolbar(true);
1021 location_bar_container_->SetBoundsRect(target_bounds); 1023 location_bar_container_->SetBoundsRect(target_bounds);
1022 } 1024 }
1023 } 1025 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698