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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h

Issue 1528483002: Add chrome.input.ime.activate and chrome.input.ime.deactivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/extensions/api/input_ime/input_ime_api_nonchromeos.h
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h b/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h
index c3567aed81df176121220e570e2b94b6e3756fa1..e678e48c1ca0390358d01e963e62837841ae2349 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h
@@ -7,6 +7,7 @@
#include "chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h"
#include "chrome/browser/profiles/profile.h"
+#include "extensions/browser/extension_function.h"
class Profile;
@@ -18,9 +19,43 @@ class InputImeEventRouter : public InputImeEventRouterBase {
explicit InputImeEventRouter(Profile* profile);
~InputImeEventRouter() override;
+ bool RegisterImeExtension(const std::string& extension_id);
+ void UnregisterImeExtension(const std::string& extension_id);
+
+ ui::IMEEngineHandlerInterface* GetActiveEngine(
+ const std::string& extension_id);
+
+ void SetActiveEngine(const std::string& extension_id);
+
+ private:
+ // The id of the all registered extensions.
+ std::vector<std::string> extension_ids_;
+
DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter);
};
+class InputImeActivateFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("input.ime.activate", INPUT_IME_ACTIVATE)
+
+ protected:
+ ~InputImeActivateFunction() override {}
+
+ // ExtensionFunction:
+ bool RunSync() override;
Devlin 2016/01/11 21:48:34 Read comments in extension_function.h above RunSyn
Azure Wei 2016/01/13 02:28:10 Done.
+};
+
+class InputImeDeactivateFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("input.ime.deactivate", INPUT_IME_DEACTIVATE)
+
+ protected:
+ ~InputImeDeactivateFunction() override {}
+
+ // ExtensionFunction:
+ bool RunSync() override;
+};
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_NONCHROMEOS_H_

Powered by Google App Engine
This is Rietveld 408576698