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

Unified Diff: ui/views/test/views_test_base.cc

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move to ash/ime/ Created 9 years 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
« no previous file with comments | « ui/views/test/views_test_base.h ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/views_test_base.cc
diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc
index e586edbb3e6dacd3f419764af00a8275e5f1d2ab..d172c175d568a77685a3c3adc96949141c23d3d6 100644
--- a/ui/views/test/views_test_base.cc
+++ b/ui/views/test/views_test_base.cc
@@ -9,8 +9,48 @@
#endif
#if defined(USE_AURA)
+#include "base/compiler_specific.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/test_activation_client.h"
+#include "ui/base/ime/input_method.h"
+
+namespace {
+
+class DummyInputMethod : public ui::InputMethod {
+ public:
+ DummyInputMethod() {}
+ virtual ~DummyInputMethod() {}
+
+ // ui::InputMethod overrides:
+ virtual void SetDelegate(
+ ui::internal::InputMethodDelegate* delegate) OVERRIDE {}
+ virtual void Init(bool focused) OVERRIDE {}
+ virtual void OnFocus() OVERRIDE {}
+ virtual void OnBlur() OVERRIDE {}
+ virtual void SetFocusedTextInputClient(
+ ui::TextInputClient* client) OVERRIDE {}
+ virtual ui::TextInputClient* GetTextInputClient() const OVERRIDE {
+ return NULL;
+ }
+ virtual void DispatchKeyEvent(
+ const base::NativeEvent& native_key_event) OVERRIDE {}
+ virtual void OnTextInputTypeChanged(
+ const ui::TextInputClient* client) OVERRIDE {}
+ virtual void OnCaretBoundsChanged(
+ const ui::TextInputClient* client) OVERRIDE {}
+ virtual void CancelComposition(const ui::TextInputClient* client) OVERRIDE {}
+ virtual std::string GetInputLocale() OVERRIDE { return ""; }
+ virtual base::i18n::TextDirection GetInputTextDirection() OVERRIDE {
+ return base::i18n::UNKNOWN_DIRECTION;
+ }
+ virtual bool IsActive() OVERRIDE { return true; }
+ virtual ui::TextInputType GetTextInputType() const OVERRIDE {
+ return ui::TEXT_INPUT_TYPE_NONE;
+ }
+};
+
+} // namespace
#endif
namespace views {
@@ -23,6 +63,10 @@ ViewsTestBase::ViewsTestBase()
#endif
#if defined(USE_AURA)
test_activation_client_.reset(new aura::test::TestActivationClient);
+ test_input_method_.reset(new DummyInputMethod);
+ aura::RootWindow::GetInstance()->SetProperty(
+ aura::client::kRootWindowInputMethod,
+ test_input_method_.get());
#endif
}
« no previous file with comments | « ui/views/test/views_test_base.h ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698