diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-15 18:15:23 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-15 18:15:23 +0000 |
commit | 0e46c2782de8924ca473e96dcba2e800f31e47a2 (patch) | |
tree | 661244985c8e14e8ce41f591cd4b8ebb40d22908 /ui/views | |
parent | 211a4a4eff8cb6b693a3cb2e3bf50df599c5184c (diff) | |
download | chromium_src-0e46c2782de8924ca473e96dcba2e800f31e47a2.zip chromium_src-0e46c2782de8924ca473e96dcba2e800f31e47a2.tar.gz chromium_src-0e46c2782de8924ca473e96dcba2e800f31e47a2.tar.bz2 |
aura/ash split: Moves RootWindowEventFilter and InputMethodEventFilter to ui/aura/.
All of InputMethodEventFilter and more than half of
RootWindowEventFilter were copied verbatim to a
DesktopRootWindowEventFilter. Instead of copying the other half for
another patch, I'm just moving RWEF and deleting the desktop version.
(InputMethodEventFilterUnittest was simple enough to move with the
file, but RootWindowEventFilter seems to act more like an integraiton
test of a lot of the stuff on Shell.)
BUG=125106
Review URL: https://chromiumcodereview.appspot.com/10332145
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/widget/desktop_native_widget_helper_aura.cc | 20 | ||||
-rw-r--r-- | ui/views/widget/desktop_native_widget_helper_aura.h | 10 |
2 files changed, 26 insertions, 4 deletions
diff --git a/ui/views/widget/desktop_native_widget_helper_aura.cc b/ui/views/widget/desktop_native_widget_helper_aura.cc index 3858836..c109b9f 100644 --- a/ui/views/widget/desktop_native_widget_helper_aura.cc +++ b/ui/views/widget/desktop_native_widget_helper_aura.cc @@ -7,8 +7,9 @@ #include "ui/aura/root_window.h" #include "ui/aura/desktop/desktop_activation_client.h" #include "ui/aura/desktop/desktop_dispatcher_client.h" -#include "ui/aura/desktop/desktop_root_window_event_filter.h" #include "ui/aura/client/dispatcher_client.h" +#include "ui/aura/shared/input_method_event_filter.h" +#include "ui/aura/shared/root_window_event_filter.h" #include "ui/views/widget/native_widget_aura.h" #if defined(OS_WIN) @@ -21,10 +22,14 @@ namespace views { DesktopNativeWidgetHelperAura::DesktopNativeWidgetHelperAura( NativeWidgetAura* widget) : widget_(widget), + root_window_event_filter_(NULL), is_embedded_window_(false) { } -DesktopNativeWidgetHelperAura::~DesktopNativeWidgetHelperAura() {} +DesktopNativeWidgetHelperAura::~DesktopNativeWidgetHelperAura() { + if (root_window_event_filter_) + root_window_event_filter_->RemoveFilter(input_method_filter_.get()); +} void DesktopNativeWidgetHelperAura::PreInitialize( const Widget::InitParams& params) { @@ -49,8 +54,15 @@ void DesktopNativeWidgetHelperAura::PreInitialize( } root_window_.reset(new aura::RootWindow(bounds)); root_window_->Init(); - root_window_->SetEventFilter( - new aura::DesktopRootWindowEventFilter(root_window_.get())); + + root_window_event_filter_ = + new aura::shared::RootWindowEventFilter(root_window_.get()); + root_window_->SetEventFilter(root_window_event_filter_); + + input_method_filter_.reset( + new aura::shared::InputMethodEventFilter(root_window_.get())); + root_window_event_filter_->AddFilter(input_method_filter_.get()); + root_window_->AddRootWindowObserver(this); aura::client::SetActivationClient( diff --git a/ui/views/widget/desktop_native_widget_helper_aura.h b/ui/views/widget/desktop_native_widget_helper_aura.h index 9f3ec1f..9011859 100644 --- a/ui/views/widget/desktop_native_widget_helper_aura.h +++ b/ui/views/widget/desktop_native_widget_helper_aura.h @@ -14,6 +14,10 @@ namespace aura { class RootWindow; +namespace shared { +class InputMethodEventFilter; +class RootWindowEventFilter; +} } namespace ui { @@ -56,6 +60,12 @@ class VIEWS_EXPORT DesktopNativeWidgetHelperAura // Optionally, a RootWindow that we attach ourselves to. scoped_ptr<aura::RootWindow> root_window_; + // Toplevel event filter which dispatches to other event filters. + aura::shared::RootWindowEventFilter* root_window_event_filter_; + + // An event filter that pre-handles all key events to send them to an IME. + scoped_ptr<aura::shared::InputMethodEventFilter> input_method_filter_; + // We want some windows (omnibox, status bar) to have their own // NativeWidgetAura, but still act as if they're screen bounded toplevel // windows. |