diff options
author | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 07:22:05 +0000 |
---|---|---|
committer | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 07:22:05 +0000 |
commit | 375755b38db43f1e23742a3cad31efddf2111f18 (patch) | |
tree | 5032d960faf5b4406676589728fcf382351eb177 /ash/shell.cc | |
parent | f3c06962021d87a78e9dc6662d99af06494ebd7c (diff) | |
download | chromium_src-375755b38db43f1e23742a3cad31efddf2111f18.zip chromium_src-375755b38db43f1e23742a3cad31efddf2111f18.tar.gz chromium_src-375755b38db43f1e23742a3cad31efddf2111f18.tar.bz2 |
Process all global shortcuts for Ash after InputMethodEventFilter.
This CL is for crbug.com/123856 (Aura shell applies accelerators without giving apps the option of handling key events). Currently, shortcuts for IME/layout switching (Shift+Alt, Ctrl+space, and so on) are processed before InputMethodEventFilter, and other Ash global shortcuts are processed after the filter. This is for ensuring that the IME shortcuts always work even if an IME (or an IME extension - http://dev.chromium.org/developers/design-documents/extensions/proposed-changes/apis-under-development/input-method-editor) tries to consume the shortcuts. However, this strategy is not compatible with crbug.com/123856. In order to fix crbug.com/123856, we sometimes have to process an Ash global shortcut key (including IME ones) after the key is passed to a web page.
This CL modifies accelerator_table.cc and shell.cc so that they process IME shortcuts after InputMethodEventFilter, and also simplifies ash/accelerators/ and ui/base/accelerators/accelerator_manager.cc by removing code for processing pre-IME shortcuts.
BUG=123856
TEST=ran aura_shell_unittests and ui_unittests
Review URL: https://chromiumcodereview.appspot.com/10155015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell.cc')
-rw-r--r-- | ash/shell.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index 4fbc9ef..e985684 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -651,16 +651,15 @@ void Shell::Init() { AddRootWindowEventFilter(partial_screenshot_filter_.get()); AddShellObserver(partial_screenshot_filter_.get()); - // Then AcceleratorFilter and InputMethodEventFilter must be added (in this - // order) since they have the second highest priority. + // InputMethodEventFilter must be the third one. It has to be added before + // AcceleratorFilter. DCHECK_EQ(2U, GetRootWindowEventFilterCount()); + input_method_filter_.reset(new internal::InputMethodEventFilter); + AddRootWindowEventFilter(input_method_filter_.get()); #if !defined(OS_MACOSX) accelerator_filter_.reset(new internal::AcceleratorFilter); AddRootWindowEventFilter(accelerator_filter_.get()); - DCHECK_EQ(3U, GetRootWindowEventFilterCount()); #endif - input_method_filter_.reset(new internal::InputMethodEventFilter); - AddRootWindowEventFilter(input_method_filter_.get()); system_gesture_filter_.reset(new internal::SystemGestureEventFilter); AddRootWindowEventFilter(system_gesture_filter_.get()); |