Index: chrome/browser/chromeos/extensions/input_method_api.cc |
diff --git a/chrome/browser/chromeos/extensions/input_method_api.cc b/chrome/browser/chromeos/extensions/input_method_api.cc |
index ce70b3642b55a32b673897124fcff817d1e3551c..f40a121a209d877fdf734be4967c92f9f47c0da2 100644 |
--- a/chrome/browser/chromeos/extensions/input_method_api.cc |
+++ b/chrome/browser/chromeos/extensions/input_method_api.cc |
@@ -14,6 +14,7 @@ |
#include "base/values.h" |
#include "build/build_config.h" |
#include "chrome/browser/chromeos/extensions/dictionary_event_router.h" |
+#include "chrome/browser/chromeos/extensions/ime_menu_event_router.h" |
#include "chrome/browser/chromeos/extensions/input_method_event_router.h" |
#include "chrome/browser/chromeos/input_method/input_method_util.h" |
#include "chrome/browser/extensions/api/input_ime/input_ime_api.h" |
@@ -186,11 +187,17 @@ const char InputMethodAPI::kOnDictionaryLoaded[] = |
const char InputMethodAPI::kOnInputMethodChanged[] = |
"inputMethodPrivate.onChanged"; |
+// static |
+const char InputMethodAPI::kOnImeMenuActivationChanged[] = |
+ "inputMethodPrivate.onImeMenuActivationChanged"; |
Devlin
2016/01/05 18:50:02
... Why doesn't inputMethodPrivate use the auto-ge
Azure Wei
2016/01/06 11:50:44
There's no public API in chrome.inputMethodPrivate
Devlin
2016/01/07 18:35:31
I know it's not listed in schemas.gypi, but my que
Shu Chen
2016/01/08 01:15:56
That may be because of the historical reasons. The
Devlin
2016/01/13 18:11:27
Yeah, a separate CL is fine. But I'd like it to b
|
+ |
InputMethodAPI::InputMethodAPI(content::BrowserContext* context) |
: context_(context) { |
EventRouter::Get(context_)->RegisterObserver(this, kOnInputMethodChanged); |
EventRouter::Get(context_)->RegisterObserver(this, kOnDictionaryChanged); |
EventRouter::Get(context_)->RegisterObserver(this, kOnDictionaryLoaded); |
+ EventRouter::Get(context_) |
+ ->RegisterObserver(this, kOnImeMenuActivationChanged); |
ExtensionFunctionRegistry* registry = |
ExtensionFunctionRegistry::GetInstance(); |
registry->RegisterFunction<GetInputMethodConfigFunction>(); |
@@ -234,6 +241,11 @@ void InputMethodAPI::OnListenerAdded( |
if (details.event_name == kOnDictionaryLoaded) { |
dictionary_event_router_->DispatchLoadedEventIfLoaded(); |
} |
+ } else if (details.event_name == kOnImeMenuActivationChanged) { |
+ if (!ime_menu_event_router_.get()) { |
+ ime_menu_event_router_.reset( |
+ new chromeos::ExtensionImeMenuEventRouter(context_)); |
+ } |
} |
} |