diff options
author | shuchen <shuchen@chromium.org> | 2015-06-10 00:48:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-10 07:49:03 +0000 |
commit | 29f3c7af2b324b9b5d9194d40fe26261577291d6 (patch) | |
tree | 3599d3f3212599d93625df8076d0f4e5d4e54768 /ash/shell.h | |
parent | 2475986c9476407f0cec00d2eb660b480db30aae (diff) | |
download | chromium_src-29f3c7af2b324b9b5d9194d40fe26261577291d6.zip chromium_src-29f3c7af2b324b9b5d9194d40fe26261577291d6.tar.gz chromium_src-29f3c7af2b324b9b5d9194d40fe26261577291d6.tar.bz2 |
Refactoring the ownership of ui::InputMethod.
This is IMF refactoring according to the design:
- For @google.com:
https://docs.google.com/document/d/14PQN4fbbSTlJmIk6qk7RzsuNr7O22DUTfNQ6slxKWV0
- For @chromium.org:
https://docs.google.com/document/d/1sDES_kuEVUjb_FwCvKsg0Ef48edq5lAx589r0qUtG4g
This cl includes some fundamental changes:
1) ui::InputMethod is created & owned by aura::WindowTreeHost.
Therefore, the InputMethod instance can be accessed through
root_window->GetHost()->GetInputMethod, and no need to save
kRootWindowInputMethodKey instance to the root window
anymore.
2) Removed InputMethodEventFilter, therefore no need the flag
IsTranslated()/SetTranslated() on ui::KeyEvent.
3) Makes aura::WindowTreeHost as a ui::EventSource, because all
kinds of WindowTreeHost are also ui::EventSource. Therefore,
WindowTreeHost can override DeliverEventToProcessor method
to intercept key events for input method processing.
Note:
1) The key events processing by input method happens after event
rewriters and before the EventHandler's, which remains no
change to original on desktop environment. For Ash, the IME key
event handling is moved ahead of some other handles:
- MagnifierKeyScroller (CrOS only): handles Arrow keys when
magnification is enabled.
- SpokenFeedbackToggler (CrOS only): handles F6 key when
SpokenFeedbackToggler is enabled.
- OverlayEventFilter: handles ESC/OEM_2/HELP/F14 keys to
cancel the overlay UI.
2) For Ash, remains the singleton ui::InputMethod instance,
owned by DisplayController. Because if let each
AshWindowTreeHost own separated ui::InputMethod instances,
it will break things:
a) There is a test: ExtendedDesktopTest.KeyEventsOnLockScreen,
which tests the text field in root window X can be inserted
with text while dispatching key events to root window Y. I
think this test makes no sense and will confirm with oshima@.
b) For now for Ozone, DrmWindowHost::CanDispatchEvent()
always returns true, so that only primary window tree host
can receive the key events, which makes the "primary"
InputMethod can receive the key events.
c) For Virtual Keyboard on CrOS, it listens to the notification
through InputMethodObserver::OnShowImeIfNeeded(), which is
bound to the specific InputMethod instance. However, the
Virtual Keyboard should work cross multiple root windows &
InputMethod instances.
BUG=474828
TEST=Verified on local builds, including linux, cros, win7 & win8.1. And all tests passed.
Review URL: https://codereview.chromium.org/1155013005
Cr-Commit-Position: refs/heads/master@{#333698}
Diffstat (limited to 'ash/shell.h')
-rw-r--r-- | ash/shell.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/ash/shell.h b/ash/shell.h index bba346b..db196e6 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -65,7 +65,6 @@ class TooltipController; namespace wm { class AcceleratorFilter; class CompoundEventFilter; -class InputMethodEventFilter; class NestedAcceleratorController; class ShadowController; class VisibilityController; @@ -346,9 +345,6 @@ class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate, } DisplayManager* display_manager() { return display_manager_.get(); } - ::wm::InputMethodEventFilter* input_method_filter() { - return input_method_filter_.get(); - } ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); } @@ -706,9 +702,6 @@ class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate, // An event filter that pre-handles global accelerators. scoped_ptr< ::wm::AcceleratorFilter> accelerator_filter_; - // An event filter that pre-handles all key events to send them to an IME. - scoped_ptr< ::wm::InputMethodEventFilter> input_method_filter_; - scoped_ptr<DisplayManager> display_manager_; scoped_ptr<LocaleNotificationController> locale_notification_controller_; |