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; |
} |