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

Unified Diff: mandoline/ui/aura/native_widget_view_manager.cc

Issue 1155013005: Refactoring the ownership of ui::InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed bot failure: cast_shell_linux Created 5 years, 6 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: mandoline/ui/aura/native_widget_view_manager.cc
diff --git a/mandoline/ui/aura/native_widget_view_manager.cc b/mandoline/ui/aura/native_widget_view_manager.cc
index da6f0310aa29163b49265dbd7bdd55e2d64083dd..4c741022a2870b5ceb658f860d0bfa103c417273 100644
--- a/mandoline/ui/aura/native_widget_view_manager.cc
+++ b/mandoline/ui/aura/native_widget_view_manager.cc
@@ -8,7 +8,6 @@
#include "mandoline/ui/aura/window_tree_host_mojo.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/converters/input_events/input_events_type_converters.h"
-#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/default_capture_client.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
@@ -34,53 +33,6 @@ class FocusRulesImpl : public wm::BaseFocusRules {
DISALLOW_COPY_AND_ASSIGN(FocusRulesImpl);
};
-class MinimalInputEventFilter : public ui::internal::InputMethodDelegate,
- public ui::EventHandler {
- public:
- explicit MinimalInputEventFilter(aura::Window* root)
- : root_(root) {
- input_method_.reset(new InputMethodMandoline(this));
- input_method_->OnFocus();
- root_->AddPreTargetHandler(this);
- root_->SetProperty(aura::client::kRootWindowInputMethodKey,
- input_method_.get());
- }
-
- ~MinimalInputEventFilter() override {
- root_->RemovePreTargetHandler(this);
- root_->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 =
- root_->GetHost()->dispatcher()->OnEventFromSource(&aura_event);
- return aura_event.handled() || details.dispatcher_destroyed;
- }
-
- aura::Window* root_;
- scoped_ptr<ui::InputMethod> input_method_;
-
- DISALLOW_COPY_AND_ASSIGN(MinimalInputEventFilter);
-};
-
} // namespace
NativeWidgetViewManager::NativeWidgetViewManager(
@@ -92,9 +44,6 @@ NativeWidgetViewManager::NativeWidgetViewManager(
window_tree_host_.reset(new WindowTreeHostMojo(shell, view_));
window_tree_host_->InitHost();
- ime_filter_.reset(
- new MinimalInputEventFilter(window_tree_host_->window()));
-
focus_client_.reset(new wm::FocusController(new FocusRulesImpl));
aura::client::SetFocusClient(window_tree_host_->window(),

Powered by Google App Engine
This is Rietveld 408576698