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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 11742012: views: Make sure the event flags are used correctly for all events that select a menu item. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index bacc1c915bd9801a1b07ceb957de3ba47f442288..dd6a34231113edce03555549320ec2d6aa5fd187 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -272,7 +272,7 @@ MenuItemView* MenuController::Run(Widget* parent,
const gfx::Rect& bounds,
MenuItemView::AnchorPosition position,
bool context_menu,
- int* result_mouse_event_flags) {
+ int* result_event_flags) {
exit_type_ = EXIT_NONE;
possible_drag_ = false;
drag_in_progress_ = false;
@@ -351,8 +351,8 @@ MenuItemView* MenuController::Run(Widget* parent,
// In case we're nested, reset result_.
result_ = NULL;
- if (result_mouse_event_flags)
- *result_mouse_event_flags = result_mouse_event_flags_;
+ if (result_event_flags)
+ *result_event_flags = accept_event_flags_;
if (exit_type_ == EXIT_OUTERMOST) {
SetExitType(EXIT_NONE);
@@ -524,7 +524,7 @@ void MenuController::OnGestureEvent(SubmenuView* source,
!(part.menu->HasSubmenu())) {
if (part.menu->GetDelegate()->IsTriggerableEvent(
part.menu, *event)) {
- Accept(part.menu, 0);
+ Accept(part.menu, event->flags());
}
event->StopPropagation();
} else if (part.type == MenuPart::MENU_ITEM) {
@@ -1057,7 +1057,7 @@ MenuController::MenuController(ui::NativeTheme* theme,
exit_type_(EXIT_NONE),
did_capture_(false),
result_(NULL),
- result_mouse_event_flags_(0),
+ accept_event_flags_(0),
drop_target_(NULL),
drop_position_(MenuDelegate::DROP_UNKNOWN),
owner_(NULL),
@@ -1136,7 +1136,7 @@ void MenuController::UpdateInitialLocation(
#endif
}
-void MenuController::Accept(MenuItemView* item, int mouse_event_flags) {
+void MenuController::Accept(MenuItemView* item, int event_flags) {
DCHECK(IsBlockingRun());
result_ = item;
if (item && !menu_stack_.empty() &&
@@ -1145,7 +1145,7 @@ void MenuController::Accept(MenuItemView* item, int mouse_event_flags) {
} else {
SetExitType(EXIT_ALL);
}
- result_mouse_event_flags_ = mouse_event_flags;
+ accept_event_flags_ = event_flags;
}
bool MenuController::ShowSiblingMenu(SubmenuView* source,
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698