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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 1155013005: Refactoring the ownership of ui::InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed. Created 5 years, 7 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
Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index c82ced73bb74b4175c43a6b5da51e8dc80031b95..b808763719a6d4f8f2c7eef7977f05d2a10bf216 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -51,7 +51,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/shadow_controller.h"
#include "ui/wm/core/shadow_types.h"
@@ -310,8 +309,6 @@ void DesktopNativeWidgetAura::OnHostClosed() {
tooltip_controller_.reset();
}
- root_window_event_filter_->RemoveHandler(input_method_event_filter_.get());
-
window_tree_client_.reset(); // Uses host_->dispatcher() at destruction.
capture_client_.reset(); // Uses host_->dispatcher() at destruction.
@@ -326,7 +323,7 @@ void DesktopNativeWidgetAura::OnHostClosed() {
focus_client_.reset();
host_->RemoveObserver(this);
- host_.reset(); // Uses input_method_event_filter_ at destruction.
+ host_.reset();
// WindowEventDispatcher owns |desktop_window_tree_host_|.
desktop_window_tree_host_ = NULL;
content_window_ = NULL;
@@ -486,8 +483,6 @@ void DesktopNativeWidgetAura::InitNativeWidget(
position_client_.reset(new DesktopScreenPositionClient(host_->window()));
- InstallInputMethodEventFilter();
-
drag_drop_client_ = desktop_window_tree_host_->CreateDragDropClient(
native_cursor_manager_);
aura::client::SetDragDropClient(host_->window(),
@@ -637,8 +632,7 @@ InputMethod* DesktopNativeWidgetAura::CreateInputMethod() {
if (switches::IsTextInputFocusManagerEnabled())
return new NullInputMethod();
- ui::InputMethod* host = input_method_event_filter_->input_method();
- return new InputMethodBridge(this, host, false);
+ return new InputMethodBridge(this, GetHostInputMethod(), false);
}
internal::InputMethodDelegate*
@@ -647,7 +641,7 @@ internal::InputMethodDelegate*
}
ui::InputMethod* DesktopNativeWidgetAura::GetHostInputMethod() {
- return input_method_event_filter_->input_method();
+ return host()->GetInputMethod();
}
void DesktopNativeWidgetAura::CenterWindow(const gfx::Size& size) {
@@ -1221,16 +1215,6 @@ void DesktopNativeWidgetAura::OnHostMoved(const aura::WindowTreeHost* host,
////////////////////////////////////////////////////////////////////////////////
// DesktopNativeWidgetAura, private:
-void DesktopNativeWidgetAura::InstallInputMethodEventFilter() {
- DCHECK(!input_method_event_filter_.get());
-
- input_method_event_filter_.reset(new wm::InputMethodEventFilter(
- host_->GetAcceleratedWidget()));
- input_method_event_filter_->SetInputMethodPropertyInRootWindow(
- host_->window());
- root_window_event_filter_->AddHandler(input_method_event_filter_.get());
-}
-
void DesktopNativeWidgetAura::UpdateWindowTransparency() {
content_window_->SetTransparent(
desktop_window_tree_host_->ShouldWindowContentsBeTransparent());

Powered by Google App Engine
This is Rietveld 408576698