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

Unified Diff: ui/views/focus/accelerator_handler_win.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/focus/accelerator_handler_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/focus/accelerator_handler_win.cc
diff --git a/ui/views/focus/accelerator_handler_win.cc b/ui/views/focus/accelerator_handler_win.cc
index 13c3081ff85899ceafe1050194a110c101f7d7a0..5216b862305def149169cc3d6acda4e9c6d493da 100644
--- a/ui/views/focus/accelerator_handler_win.cc
+++ b/ui/views/focus/accelerator_handler_win.cc
@@ -15,9 +15,7 @@ namespace views {
AcceleratorHandler::AcceleratorHandler() {
}
-bool AcceleratorHandler::Dispatch(const MSG& msg) {
- bool process_message = true;
-
+bool AcceleratorHandler::Dispatch(const base::NativeEvent& msg) {
if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST) {
Widget* widget = Widget::GetTopLevelWidgetForNativeView(msg.hwnd);
FocusManager* focus_manager = widget ? widget->GetFocusManager() : NULL;
@@ -26,11 +24,11 @@ bool AcceleratorHandler::Dispatch(const MSG& msg) {
case WM_KEYDOWN:
case WM_SYSKEYDOWN: {
KeyEvent event(msg);
- process_message = focus_manager->OnKeyEvent(event);
- if (!process_message) {
+ if (!focus_manager->OnKeyEvent(event)) {
// Record that this key is pressed so we can remember not to
// translate and dispatch the associated WM_KEYUP.
pressed_keys_.insert(msg.wParam);
+ return true;
}
break;
}
@@ -49,11 +47,8 @@ bool AcceleratorHandler::Dispatch(const MSG& msg) {
}
}
- if (process_message) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
return true;
}
« no previous file with comments | « ui/views/focus/accelerator_handler_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698