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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_view.cc

Issue 380813003: Remove remaining overrides of View::HitTestRect() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DoesIntersectRect() overrides made private Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.h ('k') | ui/views/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/toolbar_view.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc
index 107005e2e3be0b2fceece486f29051e315389065..e9aacdfc5bc9fdede452b6aa3ac6d5443e1a478e 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -67,6 +67,7 @@
#include "ui/native_theme/native_theme_aura.h"
#include "ui/views/controls/menu/menu_listener.h"
#include "ui/views/focus/view_storage.h"
+#include "ui/views/view_targeter.h"
#include "ui/views/widget/tooltip_manager.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/non_client_view.h"
@@ -140,6 +141,9 @@ ToolbarView::ToolbarView(Browser* browser)
this)) {
set_id(VIEW_ID_TOOLBAR);
+ SetEventTargeter(
+ scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
+
chrome::AddCommandObserver(browser_, IDC_BACK, this);
chrome::AddCommandObserver(browser_, IDC_FORWARD, this);
chrome::AddCommandObserver(browser_, IDC_RELOAD, this);
@@ -632,16 +636,6 @@ void ToolbarView::Layout() {
app_menu_->SetBounds(next_element_x, child_y, app_menu_width, child_height);
}
-bool ToolbarView::HitTestRect(const gfx::Rect& rect) const {
- // Fall through to the tab strip above us if none of |rect| intersects
- // with this view (intersection with the top shadow edge does not
- // count as intersection with this view).
- if (rect.bottom() < content_shadow_height())
- return false;
- // Otherwise let our superclass take care of it.
- return AccessiblePaneView::HitTestRect(rect);
-}
-
void ToolbarView::OnPaint(gfx::Canvas* canvas) {
View::OnPaint(canvas);
@@ -706,6 +700,20 @@ void ToolbarView::RemovePaneFocus() {
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, private:
+// views::ViewTargeterDelegate:
+bool ToolbarView::DoesIntersectRect(const views::View* target,
+ const gfx::Rect& rect) const {
+ CHECK_EQ(target, this);
+
+ // Fall through to the tab strip above us if none of |rect| intersects
+ // with this view (intersection with the top shadow edge does not
+ // count as intersection with this view).
+ if (rect.bottom() < content_shadow_height())
+ return false;
+ // Otherwise let our superclass take care of it.
+ return ViewTargeterDelegate::DoesIntersectRect(this, rect);
+}
+
bool ToolbarView::ShouldShowUpgradeRecommended() {
#if defined(OS_CHROMEOS)
// In chromeos, the update recommendation is shown in the system tray. So it
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698