Index: mojo/views/native_widget_view_manager.cc |
diff --git a/mojo/views/native_widget_view_manager.cc b/mojo/views/native_widget_view_manager.cc |
index 05e33d6e7f661e56bd9741b7a388b01b2d40e9ba..c23fe69d82d7b7f0bd56e28ac6a61463384c89b4 100644 |
--- a/mojo/views/native_widget_view_manager.cc |
+++ b/mojo/views/native_widget_view_manager.cc |
@@ -34,50 +34,13 @@ class FocusRulesImpl : public wm::BaseFocusRules { |
DISALLOW_COPY_AND_ASSIGN(FocusRulesImpl); |
}; |
-class InputMethodImpl : public ui::MockInputMethod { |
- public: |
- explicit InputMethodImpl(ui::internal::InputMethodDelegate* delegate) |
- : MockInputMethod(delegate), |
- delegate_(delegate) { |
- } |
- virtual ~InputMethodImpl() { |
- } |
- |
- // MockInputMethod: |
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE { |
- // If no text input client, do nothing. |
- if (!GetTextInputClient()) |
- return DispatchKeyEventPostIME(event); |
- |
- const bool handled = DispatchKeyEventPostIME(event); |
- if (event.type() == ui::ET_KEY_PRESSED && GetTextInputClient()) { |
- const uint16 ch = event.GetCharacter(); |
- if (ch) { |
- GetTextInputClient()->InsertChar(ch, event.flags()); |
- return true; |
- } |
- } |
- return handled; |
- } |
- |
- private: |
- bool DispatchKeyEventPostIME(const ui::KeyEvent& event) const { |
- return delegate_ && delegate_->DispatchKeyEventPostIME(event); |
- } |
- |
- ui::internal::InputMethodDelegate* delegate_; |
- |
- DISALLOW_COPY_AND_ASSIGN(InputMethodImpl); |
-}; |
- |
class MinimalInputEventFilter : public ui::internal::InputMethodDelegate, |
public ui::EventHandler { |
public: |
explicit MinimalInputEventFilter(aura::Window* root) |
- : root_(root) { |
- ui::SetUpInputMethodFactoryForTesting(); |
- input_method_.reset(new InputMethodImpl(this)); |
- ui::InitializeInputMethod(); |
+ : root_(root), |
+ input_method_( |
+ ui::CreateInputMethod(this, gfx::kNullAcceleratedWidget).Pass()) { |
input_method_->Init(true); |
root_->AddPreTargetHandler(this); |
root_->SetProperty(aura::client::kRootWindowInputMethodKey, |