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

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

Issue 15912004: Add private API to notify end of initialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments Created 7 years, 7 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 ac209e0a27ac25041c48341902edb3d821fa07d5..504f3ce18374ebf9a676501d76c3ed353640492b 100644
--- a/chrome/browser/chromeos/extensions/input_method_api.cc
+++ b/chrome/browser/chromeos/extensions/input_method_api.cc
@@ -7,6 +7,7 @@
#include "base/lazy_instance.h"
#include "base/values.h"
#include "chrome/browser/chromeos/extensions/input_method_event_router.h"
+#include "chrome/browser/extensions/api/input_ime/input_ime_api.h"
#include "chrome/browser/extensions/event_names.h"
#include "chrome/browser/extensions/extension_function_registry.h"
#include "chrome/browser/extensions/extension_system.h"
@@ -42,6 +43,25 @@ bool GetInputMethodFunction::RunImpl() {
#endif
}
+StartImeFunction::StartImeFunction() {
+}
+
+StartImeFunction::~StartImeFunction() {
+}
+
+bool StartImeFunction::RunImpl() {
+#if !defined(OS_CHROMEOS)
+ NOTREACHED();
+ return false;
+#else
+ chromeos::InputMethodEngine* engine =
+ InputImeEventRouter::GetInstance()->GetActiveEngine(extension_id());
+ if (engine)
+ engine->StartIme();
+ return true;
+#endif
+}
+
InputMethodAPI::InputMethodAPI(Profile* profile)
: profile_(profile) {
ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
@@ -49,6 +69,7 @@ InputMethodAPI::InputMethodAPI(Profile* profile)
ExtensionFunctionRegistry* registry =
ExtensionFunctionRegistry::GetInstance();
registry->RegisterFunction<GetInputMethodFunction>();
+ registry->RegisterFunction<StartImeFunction>();
}
InputMethodAPI::~InputMethodAPI() {
« no previous file with comments | « chrome/browser/chromeos/extensions/input_method_api.h ('k') | chrome/browser/chromeos/input_method/input_method_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698