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 /extensions/shell/browser | |
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 'extensions/shell/browser')
-rw-r--r-- | extensions/shell/browser/shell_desktop_controller_aura.cc | 9 | ||||
-rw-r--r-- | extensions/shell/browser/shell_desktop_controller_aura.h | 3 |
2 files changed, 0 insertions, 12 deletions
diff --git a/extensions/shell/browser/shell_desktop_controller_aura.cc b/extensions/shell/browser/shell_desktop_controller_aura.cc index 5ab8a3c..f89714a 100644 --- a/extensions/shell/browser/shell_desktop_controller_aura.cc +++ b/extensions/shell/browser/shell_desktop_controller_aura.cc @@ -32,7 +32,6 @@ #include "ui/wm/core/compound_event_filter.h" #include "ui/wm/core/cursor_manager.h" #include "ui/wm/core/focus_controller.h" -#include "ui/wm/core/input_method_event_filter.h" #include "ui/wm/core/native_cursor_manager.h" #include "ui/wm/core/native_cursor_manager_delegate.h" @@ -259,11 +258,6 @@ void ShellDesktopControllerAura::InitWindowManager() { aura::client::SetActivationClient(host_->window(), focus_controller); focus_client_.reset(focus_controller); - input_method_filter_.reset( - new wm::InputMethodEventFilter(host_->GetAcceleratedWidget())); - input_method_filter_->SetInputMethodPropertyInRootWindow(host_->window()); - root_window_event_filter_->AddHandler(input_method_filter_.get()); - capture_client_.reset( new aura::client::DefaultCaptureClient(host_->window())); @@ -319,8 +313,6 @@ void ShellDesktopControllerAura::CreateRootWindow() { void ShellDesktopControllerAura::DestroyRootWindow() { host_->RemoveObserver(this); - if (input_method_filter_) - root_window_event_filter_->RemoveHandler(input_method_filter_.get()); wm::FocusController* focus_controller = static_cast<wm::FocusController*>(focus_client_.get()); if (focus_controller) { @@ -329,7 +321,6 @@ void ShellDesktopControllerAura::DestroyRootWindow() { } root_window_event_filter_.reset(); capture_client_.reset(); - input_method_filter_.reset(); focus_client_.reset(); cursor_manager_.reset(); #if defined(OS_CHROMEOS) diff --git a/extensions/shell/browser/shell_desktop_controller_aura.h b/extensions/shell/browser/shell_desktop_controller_aura.h index 9a8bc1f..17546c1 100644 --- a/extensions/shell/browser/shell_desktop_controller_aura.h +++ b/extensions/shell/browser/shell_desktop_controller_aura.h @@ -46,7 +46,6 @@ class UserActivityPowerManagerNotifier; namespace wm { class CompoundEventFilter; class CursorManager; -class InputMethodEventFilter; } namespace extensions { @@ -121,8 +120,6 @@ class ShellDesktopControllerAura scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; - scoped_ptr<wm::InputMethodEventFilter> input_method_filter_; - scoped_ptr<aura::client::FocusClient> focus_client_; scoped_ptr<wm::CursorManager> cursor_manager_; |