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

Unified Diff: ui/views/controls/menu/menu_host_root_view.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: ui/views/controls/menu/menu_host_root_view.cc
diff --git a/ui/views/controls/menu/menu_host_root_view.cc b/ui/views/controls/menu/menu_host_root_view.cc
index 3bce4a49b6e730c7bf2a08815af388948ca52107..cd9584d16516f0758dbfc488c6e05e45f29bab01 100644
--- a/ui/views/controls/menu/menu_host_root_view.cc
+++ b/ui/views/controls/menu/menu_host_root_view.cc
@@ -19,9 +19,8 @@ MenuHostRootView::MenuHostRootView(Widget* widget,
bool MenuHostRootView::OnMousePressed(const ui::MouseEvent& event) {
forward_drag_to_menu_controller_ =
- !GetLocalBounds().Contains(event.location()) ||
- !RootView::OnMousePressed(event) ||
- DoesEventTargetEmptyMenuItem(event);
+ !GetLocalBounds().Contains(gfx::ToFlooredPoint(event.location())) ||
+ !RootView::OnMousePressed(event) || DoesEventTargetEmptyMenuItem(event);
if (forward_drag_to_menu_controller_ && GetMenuController())
GetMenuController()->OnMousePressed(submenu_, event);
@@ -72,7 +71,7 @@ MenuController* MenuHostRootView::GetMenuController() {
bool MenuHostRootView::DoesEventTargetEmptyMenuItem(
const ui::MouseEvent& event) {
- View* view = GetEventHandlerForPoint(event.location());
+ View* view = GetEventHandlerForPoint(gfx::ToFlooredPoint(event.location()));
return view && view->id() == MenuItemView::kEmptyMenuItemViewID;
}

Powered by Google App Engine
This is Rietveld 408576698