Chromium Code Reviews

Unified Diff: ui/base/ime/input_method_factory.cc

Issue 1177503003: Remove the 2-level input method system & InputMethodBridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: makes trybots green. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: ui/base/ime/input_method_factory.cc
diff --git a/ui/base/ime/input_method_factory.cc b/ui/base/ime/input_method_factory.cc
index 007608353fb88451386900e5c59709bdfe688abd..e30bf7e9a2315eff28e3e16ee60c4d5a11e70114 100644
--- a/ui/base/ime/input_method_factory.cc
+++ b/ui/base/ime/input_method_factory.cc
@@ -23,6 +23,8 @@
namespace {
+ui::InputMethod* g_input_method_for_testing = nullptr;
+
bool g_input_method_set_for_testing = false;
bool g_create_input_method_called = false;
@@ -37,6 +39,9 @@ scoped_ptr<InputMethod> CreateInputMethod(
if (!g_create_input_method_called)
g_create_input_method_called = true;
+ if (g_input_method_for_testing)
+ return make_scoped_ptr(g_input_method_for_testing);
+
if (g_input_method_set_for_testing)
return make_scoped_ptr(new MockInputMethod(delegate));
@@ -68,4 +73,8 @@ void SetUpInputMethodFactoryForTesting() {
g_input_method_set_for_testing = true;
}
+void SetUpInputMethodForTesting(InputMethod* input_method) {
+ g_input_method_for_testing = input_method;
+}
+
} // namespace ui

Powered by Google App Engine