Index: chrome/browser/ui/views/profiles/avatar_menu_button.cc |
diff --git a/chrome/browser/ui/views/profiles/avatar_menu_button.cc b/chrome/browser/ui/views/profiles/avatar_menu_button.cc |
index 046095fe0d9c018d2065a17e3c5bab942eda3fd8..d0e8023901a322b91c6eb6d9684f975aec44eea6 100644 |
--- a/chrome/browser/ui/views/profiles/avatar_menu_button.cc |
+++ b/chrome/browser/ui/views/profiles/avatar_menu_button.cc |
@@ -20,6 +20,7 @@ |
#include "components/signin/core/common/profile_management_switches.h" |
#include "content/public/browser/notification_service.h" |
#include "ui/gfx/canvas.h" |
+#include "ui/views/view_targeter.h" |
#include "ui/views/widget/widget.h" |
static inline int Round(double x) { |
@@ -38,6 +39,9 @@ AvatarMenuButton::AvatarMenuButton(Browser* browser, bool disabled) |
button_on_right_(false) { |
// In RTL mode, the avatar icon should be looking the opposite direction. |
EnableCanvasFlippingForRTLUI(true); |
+ |
+ SetEventTargeter( |
+ scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); |
} |
AvatarMenuButton::~AvatarMenuButton() { |
@@ -78,8 +82,11 @@ void AvatarMenuButton::OnPaint(gfx::Canvas* canvas) { |
button_icon_.height(), dst_x, dst_y, dst_width, dst_height, false); |
} |
-bool AvatarMenuButton::HitTestRect(const gfx::Rect& rect) const { |
- return !disabled_ && views::MenuButton::HitTestRect(rect); |
+bool AvatarMenuButton::DoesIntersectRect(const views::View* target, |
+ const gfx::Rect& rect) const { |
+ CHECK_EQ(target, this); |
+ return !disabled_ && |
+ views::ViewTargeterDelegate::DoesIntersectRect(target, rect); |
} |
void AvatarMenuButton::SetAvatarIcon(const gfx::Image& icon, |