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

Unified Diff: content/shell/browser/shell_platform_data_aura.cc

Issue 1155013005: Refactoring the ownership of ui::InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pls be green! 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: content/shell/browser/shell_platform_data_aura.cc
diff --git a/content/shell/browser/shell_platform_data_aura.cc b/content/shell/browser/shell_platform_data_aura.cc
index d0e806d0513ce938f68cad11ffe1a7d97494c916..ab2a59c9451a8929254d745ea72b7c221373194d 100644
--- a/content/shell/browser/shell_platform_data_aura.cc
+++ b/content/shell/browser/shell_platform_data_aura.cc
@@ -56,54 +56,6 @@ class FillLayout : public aura::LayoutManager {
DISALLOW_COPY_AND_ASSIGN(FillLayout);
};
-class MinimalInputEventFilter : public ui::internal::InputMethodDelegate,
- public ui::EventHandler {
- public:
- explicit MinimalInputEventFilter(aura::WindowTreeHost* host)
- : host_(host),
- input_method_(ui::CreateInputMethod(this,
- gfx::kNullAcceleratedWidget)) {
- input_method_->OnFocus();
- host_->window()->AddPreTargetHandler(this);
- host_->window()->SetProperty(aura::client::kRootWindowInputMethodKey,
- input_method_.get());
- }
-
- ~MinimalInputEventFilter() override {
- host_->window()->RemovePreTargetHandler(this);
- host_->window()->SetProperty(aura::client::kRootWindowInputMethodKey,
- static_cast<ui::InputMethod*>(NULL));
- }
-
- private:
- // ui::EventHandler:
- void OnKeyEvent(ui::KeyEvent* event) override {
- // See the comment in InputMethodEventFilter::OnKeyEvent() for details.
- if (event->IsTranslated()) {
- event->SetTranslated(false);
- } else {
- if (input_method_->DispatchKeyEvent(*event))
- event->StopPropagation();
- }
- }
-
- // ui::internal::InputMethodDelegate:
- bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override {
- // See the comment in InputMethodEventFilter::DispatchKeyEventPostIME() for
- // details.
- ui::KeyEvent aura_event(event);
- aura_event.SetTranslated(true);
- ui::EventDispatchDetails details =
- host_->dispatcher()->OnEventFromSource(&aura_event);
- return aura_event.handled() || details.dispatcher_destroyed;
- }
-
- aura::WindowTreeHost* host_;
- scoped_ptr<ui::InputMethod> input_method_;
-
- DISALLOW_COPY_AND_ASSIGN(MinimalInputEventFilter);
-};
-
}
ShellPlatformDataAura* Shell::platform_ = NULL;
@@ -122,7 +74,6 @@ ShellPlatformDataAura::ShellPlatformDataAura(const gfx::Size& initial_size) {
new aura::client::DefaultCaptureClient(host_->window()));
window_tree_client_.reset(
new aura::test::TestWindowTreeClient(host_->window()));
- ime_filter_.reset(new MinimalInputEventFilter(host_.get()));
}
ShellPlatformDataAura::~ShellPlatformDataAura() {

Powered by Google App Engine
This is Rietveld 408576698