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

Unified Diff: ash/accelerators/accelerator_dispatcher_win.cc

Issue 9538015: Allows ash accelerators in wrench menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes win compile Created 8 years, 10 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: ash/accelerators/accelerator_dispatcher_win.cc
diff --git a/ash/accelerators/accelerator_dispatcher_win.cc b/ash/accelerators/accelerator_dispatcher_win.cc
index 0383b3bf5303602489d0de863084ef8c2679a11a..acd459337e85abb5d6f1d54b4156c228945f0dfd 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 ||
+ 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);
« no previous file with comments | « ash/accelerators/accelerator_dispatcher_linux.cc ('k') | ash/accelerators/nested_dispatcher_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698