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

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

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 8 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/toolbar/toolbar_button.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
index dad98d13bf9a4106a9268e14d919e5c0d03946cd..a1d7d96aedc762fbef503a33909c72956c65d852 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -55,8 +55,8 @@ gfx::Size ToolbarButton::GetPreferredSize() {
}
bool ToolbarButton::OnMousePressed(const ui::MouseEvent& event) {
- if (enabled() && ShouldShowMenu() &&
- IsTriggerableEvent(event) && HitTestPoint(event.location())) {
+ if (enabled() && ShouldShowMenu() && IsTriggerableEvent(event) &&
+ HitTestPoint(gfx::ToFlooredPoint(event.location()))) {
// Store the y pos of the mouse coordinates so we can use them later to
// determine if the user dragged the mouse down (which should pop up the
// drag down menu immediately, instead of waiting for the timer)
@@ -92,7 +92,8 @@ bool ToolbarButton::OnMouseDragged(const ui::MouseEvent& event) {
void ToolbarButton::OnMouseReleased(const ui::MouseEvent& event) {
if (IsTriggerableEvent(event) ||
- (event.IsRightMouseButton() && !HitTestPoint(event.location()))) {
+ (event.IsRightMouseButton() &&
+ !HitTestPoint(gfx::ToFlooredPoint(event.location())))) {
LabelButton::OnMouseReleased(event);
}

Powered by Google App Engine
This is Rietveld 408576698