Chromium Code Reviews| Index: ash/accelerators/accelerator_dispatcher_win.cc |
| diff --git a/ash/accelerators/accelerator_dispatcher_win.cc b/ash/accelerators/accelerator_dispatcher_win.cc |
| index 0383b3bf5303602489d0de863084ef8c2679a11a..77af5193e0cc2898b6220345845fda769d0d8b5f 100644 |
| --- a/ash/accelerators/accelerator_dispatcher_win.cc |
| +++ b/ash/accelerators/accelerator_dispatcher_win.cc |
| @@ -5,6 +5,7 @@ |
| #include "ash/accelerators/accelerator_dispatcher.h" |
| #include "ash/accelerators/accelerator_controller.h" |
| +#include "ash/ime/event.h" |
| #include "ash/shell.h" |
| #include "ui/aura/env.h" |
| #include "ui/aura/event.h" |
| @@ -22,18 +23,25 @@ const int kModifierMask = (ui::EF_SHIFT_DOWN | |
| } // namespace |
| bool AcceleratorDispatcher::Dispatch(const MSG& msg) { |
| + // TODO(oshima): Consolidate win and linux. http://crbug.com/116282 |
| if (!associated_window_) |
| return false; |
| if (!ui::IsNoopEvent(msg) && !associated_window_->CanReceiveEvents()) |
| return aura::Env::GetInstance()->GetDispatcher()->Dispatch(msg); |
| - if(msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN) { |
| + if(msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN || |
|
sky
2012/02/29 22:04:18
nit: 'if(' -> 'if ('
|
| + msg.message == WM_KEYUP || msg.message = WM_SYSKEYUP) { |
| ash::AcceleratorController* accelerator_controller = |
| ash::Shell::GetInstance()->accelerator_controller(); |
| - ui::Accelerator accelerator(ui::KeyboardCodeFromNative(msg), |
| - ui::EventFlagsFromNative(msg) & kModifierMask); |
| - if (accelerator_controller && accelerator_controller->Process(accelerator)) |
| - return true; |
| + if (accelerator_controller) { |
| + ui::Accelerator accelerator(ui::KeyboardCodeFromNative(msg), |
| + ui::EventFlagsFromNative(msg) & kModifierMask); |
| + if (accelerator_controller->Process(accelerator)) |
| + return true; |
| + accelerator.set_type(TranslatedKeyEvent(msg, false).type()); |
| + if (accelerator_controller->Process(accelerator)) |
| + return true; |
| + } |
| } |
| return nested_dispatcher_->Dispatch(msg); |