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 |