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

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: nits. 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
« no previous file with comments | « ui/base/ime/input_method_factory.h ('k') | ui/base/ime/ui_base_ime.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b4aa3cd9e4a3dc618d98f48bf6ebb225c25e06ba 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,12 @@ scoped_ptr<InputMethod> CreateInputMethod(
if (!g_create_input_method_called)
g_create_input_method_called = true;
+ if (g_input_method_for_testing) {
+ ui::InputMethod* ret = g_input_method_for_testing;
+ g_input_method_for_testing = nullptr;
+ return make_scoped_ptr(ret);
+ }
+
if (g_input_method_set_for_testing)
return make_scoped_ptr(new MockInputMethod(delegate));
@@ -68,4 +76,8 @@ void SetUpInputMethodFactoryForTesting() {
g_input_method_set_for_testing = true;
}
+void SetUpInputMethodForTesting(InputMethod* input_method) {
+ g_input_method_for_testing = input_method;
+}
+
} // namespace ui
« no previous file with comments | « ui/base/ime/input_method_factory.h ('k') | ui/base/ime/ui_base_ime.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698