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

Unified Diff: chrome/browser/ui/views/profiles/avatar_menu_button.cc

Issue 380813003: Remove remaining overrides of View::HitTestRect() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase against ToT 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
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,

Powered by Google App Engine
This is Rietveld 408576698