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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api.cc

Issue 1870783003: Notifies the IME extension for IME ready with onActivate/onFocus events at start. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/input_ime/input_ime_api.cc
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
index f45589e9b44d1a0ab5001465cb87d929be16f8ef..e3496644fd97b90c2514798c77a3114f013e0718 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
@@ -374,6 +374,21 @@ InputImeAPI::~InputImeAPI() {
EventRouter::Get(browser_context_)->UnregisterObserver(this);
}
+void InputImeAPI::OnListenerAdded(const EventListenerInfo& details) {
+ if (!details.browser_context)
+ return;
+ InputImeEventRouter* event_router =
+ GetInputImeEventRouter(Profile::FromBrowserContext(
+ Profile::FromBrowserContext(details.browser_context)));
+ InputMethodEngineBase* engine =
+ event_router ? event_router->GetActiveEngine(details.extension_id)
+ : nullptr;
+
+ // Notifies the IME extension for IME ready with onActivate/onFocus events.
+ if (engine)
+ engine->Enable(engine->GetActiveComponentId());
+}
+
static base::LazyInstance<BrowserContextKeyedAPIFactory<InputImeAPI> >
g_factory = LAZY_INSTANCE_INITIALIZER;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698