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

Unified Diff: ash/accelerators/accelerator_filter.cc

Issue 9370017: Move IME shortcut keys from X to Aura [part 1 of 3]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-rebase... 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
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/ime_control_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_filter.cc
diff --git a/ash/accelerators/accelerator_filter.cc b/ash/accelerators/accelerator_filter.cc
index ee818e971d1de8943b1182097fbc285ad896cfab..957efaadba9f9908c01f71bc345f56047ec9641a 100644
--- a/ash/accelerators/accelerator_filter.cc
+++ b/ash/accelerators/accelerator_filter.cc
@@ -34,12 +34,16 @@ AcceleratorFilter::~AcceleratorFilter() {
bool AcceleratorFilter::PreHandleKeyEvent(aura::Window* target,
aura::KeyEvent* event) {
- if (event->type() == ui::ET_KEY_PRESSED && !event->is_char()) {
- return Shell::GetInstance()->accelerator_controller()->Process(
- ui::Accelerator(event->key_code(),
- event->flags() & kModifierFlagMask));
- }
- return false;
+ const ui::EventType type = event->type();
+ if (type != ui::ET_KEY_PRESSED && type != ui::ET_TRANSLATED_KEY_PRESS)
+ return false;
+ if (event->is_char())
+ return false;
+
+ ui::Accelerator accelerator(event->key_code(),
+ event->flags() & kModifierFlagMask);
+ accelerator.set_type(type);
+ return Shell::GetInstance()->accelerator_controller()->Process(accelerator);
}
bool AcceleratorFilter::PreHandleMouseEvent(aura::Window* target,
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/ime_control_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698