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

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

Issue 1552743003: Add chrome.inputMethodPrivate.onImeMenuActivationChanged API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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: 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_));
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698