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

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

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index c1bd2d64260f31d67f35cef17bc90a6c666922b5..3c914cc1723d96a688fc8e791336b7c11223f0f9 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -890,7 +890,6 @@ bool MenuController::Dispatch(const MSG& msg) {
}
case WM_CHAR:
return !SelectByChar(static_cast<char16>(msg.wParam));
-
case WM_KEYUP:
return true;
@@ -922,34 +921,26 @@ base::MessagePumpDispatcher::DispatchStatus
}
#elif defined(USE_AURA)
-base::MessagePumpDispatcher::DispatchStatus
- MenuController::Dispatch(XEvent* xev) {
+bool MenuController::Dispatch(const base::NativeEvent& xev) {
+ // XEvent* xev = event;
sadrul 2012/04/06 00:16:57 remove this line
oshima 2012/04/06 00:34:35 Oops, done. Thank you for the catch.
if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) {
aura::Env::GetInstance()->GetDispatcher()->Dispatch(xev);
- return base::MessagePumpDispatcher::EVENT_QUIT;
+ return false;
}
switch (ui::EventTypeFromNative(xev)) {
case ui::ET_KEY_PRESSED:
if (!OnKeyDown(ui::KeyboardCodeFromNative(xev)))
- return base::MessagePumpDispatcher::EVENT_QUIT;
+ return false;
- return SelectByChar(ui::KeyboardCodeFromNative(xev)) ?
- base::MessagePumpDispatcher::EVENT_QUIT :
- base::MessagePumpDispatcher::EVENT_PROCESSED;
+ return !SelectByChar(ui::KeyboardCodeFromNative(xev));
case ui::ET_KEY_RELEASED:
- return base::MessagePumpDispatcher::EVENT_PROCESSED;
+ return true;
default:
break;
}
- // TODO(oshima): Update Windows' Dispatcher to return DispatchStatus
- // instead of bool.
- if (aura::Env::GetInstance()->GetDispatcher()->Dispatch(xev) ==
- base::MessagePumpDispatcher::EVENT_IGNORED)
- return EVENT_IGNORED;
- return exit_type_ != EXIT_NONE ?
- base::MessagePumpDispatcher::EVENT_QUIT :
- base::MessagePumpDispatcher::EVENT_PROCESSED;
+ aura::Env::GetInstance()->GetDispatcher()->Dispatch(xev);
+ return exit_type_ == EXIT_NONE;
}
#endif

Powered by Google App Engine
This is Rietveld 408576698