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

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: reverted changes for MockInputMethod. 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: 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);
James Su 2015/06/12 07:58:50 Not sure if this code is correct. If more than one
Shu Chen 2015/06/12 08:51:31 Done. Doing "g_input_method_for_testing = nullptr;
+
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
This is Rietveld 408576698