| 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..3c3deb168feda5f734ce75f89b72b057c58bf565 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,10 +82,6 @@ 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);
|
| -}
|
| -
|
| void AvatarMenuButton::SetAvatarIcon(const gfx::Image& icon,
|
| bool is_rectangle) {
|
| icon_.reset(new gfx::Image(icon));
|
| @@ -90,6 +90,14 @@ void AvatarMenuButton::SetAvatarIcon(const gfx::Image& icon,
|
| SchedulePaint();
|
| }
|
|
|
| +// views::ViewTargeterDelegate:
|
| +bool AvatarMenuButton::DoesIntersectRect(const views::View* target,
|
| + const gfx::Rect& rect) const {
|
| + CHECK_EQ(target, this);
|
| + return !disabled_ &&
|
| + views::ViewTargeterDelegate::DoesIntersectRect(target, rect);
|
| +}
|
| +
|
| // views::MenuButtonListener implementation
|
| void AvatarMenuButton::OnMenuButtonClicked(views::View* source,
|
| const gfx::Point& point) {
|
|
|