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

Unified Diff: chrome/browser/chromeos/extensions/input_method_api.cc

Issue 1523593002: Add an option in language settings for activating the IME menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: 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 b9dce24e01dbd52c4efd81b1ff1a4bc47331f5bd..1980ed692ac029aa36a7de41ff74bd2e98fec8da 100644
--- a/chrome/browser/chromeos/extensions/input_method_api.cc
+++ b/chrome/browser/chromeos/extensions/input_method_api.cc
@@ -11,6 +11,7 @@
#include "base/lazy_instance.h"
#include "base/values.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"
@@ -183,11 +184,21 @@ const char InputMethodAPI::kOnDictionaryLoaded[] =
const char InputMethodAPI::kOnInputMethodChanged[] =
"inputMethodPrivate.onChanged";
+// static
+const char InputMethodAPI::kOnImeMenuActivated[] =
+ "inputMethodPrivate.onImeMenuActivated";
+
+// static
+const char InputMethodAPI::kOnImeMenuDeactivated[] =
+ "inputMethodPrivate.onImeMenuDeactivated";
+
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, kOnImeMenuActivated);
+ EventRouter::Get(context_)->RegisterObserver(this, kOnImeMenuDeactivated);
ExtensionFunctionRegistry* registry =
ExtensionFunctionRegistry::GetInstance();
registry->RegisterFunction<GetInputMethodConfigFunction>();
@@ -231,6 +242,12 @@ void InputMethodAPI::OnListenerAdded(
if (details.event_name == kOnDictionaryLoaded) {
dictionary_event_router_->DispatchLoadedEventIfLoaded();
}
+ } else if (details.event_name == kOnImeMenuActivated ||
+ details.event_name == kOnImeMenuDeactivated) {
+ if (!ime_menu_event_router_.get()) {
+ ime_menu_event_router_.reset(
+ new chromeos::ExtensionImeMenuEventRouter(context_));
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698