| 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";
|
| +
|
| 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_));
|
| + }
|
| }
|
| }
|
|
|
|
|