Index: ui/views/ime/null_input_method.h |
diff --git a/ui/views/ime/null_input_method.h b/ui/views/ime/null_input_method.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2714c90c625b6882f1ebfff340498cb1bf2c4b5f |
--- /dev/null |
+++ b/ui/views/ime/null_input_method.h |
@@ -0,0 +1,51 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_VIEWS_IME_NULL_INPUT_METHOD_H_ |
+#define UI_VIEWS_IME_NULL_INPUT_METHOD_H_ |
+ |
+#include "base/compiler_specific.h" |
+#include "base/macros.h" |
msw
2014/03/11 00:58:50
nit: is this explicitly needed here?
Yuki
2014/03/11 15:27:37
base/compiler_specific.h is for OVERRIDE macro.
ba
msw
2014/03/11 23:24:37
Sounds good.
|
+#include "ui/views/ime/input_method.h" |
+ |
+namespace views { |
+ |
+// An implementation of views::InputMethod which does nothing. |
+// |
+// We're working on removing views::InputMethod and all its family and going |
msw
2014/03/11 00:58:50
nit: I'm not sure what you mean by "family", pleas
Yuki
2014/03/11 15:27:37
Done.
|
+// to use only ui::InputMethod. This class allows us to disable all the effects |
+// come from views::InputMethodBridge by replacing it with this instance, |
msw
2014/03/11 00:58:50
nit: "that come from"
Yuki
2014/03/11 15:27:37
Done.
|
+// without a big interface change. This class also enables that we can switch |
msw
2014/03/11 00:58:50
This sentence and the above needs some grammar wor
Yuki
2014/03/11 15:27:37
Done.
|
+// between with and without views::InputMethodBridge in an easy way. |
+class NullInputMethod : public InputMethod { |
+ public: |
+ NullInputMethod(); |
+ |
+ // Overridden from InputMethod: |
+ virtual void SetDelegate(internal::InputMethodDelegate* delegate) OVERRIDE; |
+ virtual void Init(Widget* widget) OVERRIDE; |
+ virtual void OnFocus() OVERRIDE; |
+ virtual void OnBlur() OVERRIDE; |
+ virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
+ NativeEventResult* result) OVERRIDE; |
+ virtual void DispatchKeyEvent(const ui::KeyEvent& key) OVERRIDE; |
+ virtual void OnTextInputTypeChanged(View* view) OVERRIDE; |
+ virtual void OnCaretBoundsChanged(View* view) OVERRIDE; |
+ virtual void CancelComposition(View* view) OVERRIDE; |
+ virtual void OnInputLocaleChanged() OVERRIDE; |
+ virtual std::string GetInputLocale() OVERRIDE; |
+ virtual bool IsActive() OVERRIDE; |
+ virtual ui::TextInputClient* GetTextInputClient() const OVERRIDE; |
+ virtual ui::TextInputType GetTextInputType() const OVERRIDE; |
+ virtual bool IsCandidatePopupOpen() const OVERRIDE; |
+ virtual void ShowImeIfNeeded() OVERRIDE; |
+ virtual bool IsMock() const OVERRIDE; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(NullInputMethod); |
+}; |
+ |
+} // namespace views |
+ |
+#endif // UI_VIEWS_IME_NULL_INPUT_METHOD_H_ |