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

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, addressed comments 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
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/focus/accelerator_handler.h » ('j') | 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 a1438fbae8c5f9b9eef965cd06559972e1aaafad..4dd0f06e297b3e7eb6249144d015ffdf2d4e2b74 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;
@@ -914,34 +913,25 @@ bool MenuController::Dispatch(const MSG& msg) {
return exit_type_ == EXIT_NONE;
}
#elif defined(USE_AURA)
-base::MessagePumpDispatcher::DispatchStatus
- MenuController::Dispatch(XEvent* xev) {
+bool MenuController::Dispatch(const base::NativeEvent& event) {
if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) {
- aura::Env::GetInstance()->GetDispatcher()->Dispatch(xev);
- return base::MessagePumpDispatcher::EVENT_QUIT;
+ aura::Env::GetInstance()->GetDispatcher()->Dispatch(event);
+ return false;
}
- switch (ui::EventTypeFromNative(xev)) {
+ switch (ui::EventTypeFromNative(event)) {
case ui::ET_KEY_PRESSED:
- if (!OnKeyDown(ui::KeyboardCodeFromNative(xev)))
- return base::MessagePumpDispatcher::EVENT_QUIT;
+ if (!OnKeyDown(ui::KeyboardCodeFromNative(event)))
+ return false;
- return SelectByChar(ui::KeyboardCodeFromNative(xev)) ?
- base::MessagePumpDispatcher::EVENT_QUIT :
- base::MessagePumpDispatcher::EVENT_PROCESSED;
+ return !SelectByChar(ui::KeyboardCodeFromNative(event));
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(event);
+ return exit_type_ == EXIT_NONE;
}
#endif
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/focus/accelerator_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698