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

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

Issue 1554983002: Build chrome.input.ime.* API in GN mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove class InputImeEventRouter from input_ime_api.h to input_ime_api_chromeos/nonchromeos.h 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.h
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chrome/browser/extensions/api/input_ime/input_ime_api.h
index 8b34769453f076bd73d7cc9df2b3d37318534cc3..47337edf494851685b71ba2f0994ff29bcd5d7c9 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.h
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h
@@ -27,6 +27,8 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h"
+#elif defined(OS_LINUX) || defined(OS_WIN)
+#include "chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h"
#endif // defined(OS_CHROMEOS)
class Profile;
@@ -87,50 +89,20 @@ class ImeObserver : public IMEEngineObserver {
} // namespace ui
namespace extensions {
-class ExtensionRegistry;
-struct InputComponentInfo;
-
-class InputImeEventRouter {
+class InputImeKeyEventHandledFunction : public AsyncExtensionFunction {
Devlin 2016/01/05 18:39:06 Why was this moved?
Azure Wei 2016/01/06 06:53:47 Oh, I just thought it's more easy to read to move
public:
- explicit InputImeEventRouter(Profile* profile);
- ~InputImeEventRouter();
-
- bool RegisterImeExtension(
- const std::string& extension_id,
- const std::vector<extensions::InputComponentInfo>& input_components);
- void UnregisterAllImes(const std::string& extension_id);
-
- ui::IMEEngineHandlerInterface* GetEngine(const std::string& extension_id,
- const std::string& component_id);
- ui::IMEEngineHandlerInterface* GetActiveEngine(
- const std::string& extension_id);
-
- // Called when a key event was handled.
- void OnKeyEventHandled(const std::string& extension_id,
- const std::string& request_id,
- bool handled);
-
- std::string AddRequest(
- const std::string& component_id,
- ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data);
-
- private:
- typedef std::map<
- std::string,
- std::pair<std::string,
- ui::IMEEngineHandlerInterface::KeyEventDoneCallback>>
- RequestMap;
-
- // The engine map from extension_id to an engine.
- std::map<std::string, ui::IMEEngineHandlerInterface*> engine_map_;
+ DECLARE_EXTENSION_FUNCTION("input.ime.keyEventHandled",
+ INPUT_IME_KEYEVENTHANDLED)
- unsigned int next_request_id_;
- RequestMap request_map_;
- Profile* profile_;
+ protected:
+ ~InputImeKeyEventHandledFunction() override {}
- DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter);
+ // ExtensionFunction:
+ bool RunAsync() override;
};
+class InputImeEventRouter;
+
class InputImeEventRouterFactory {
public:
static InputImeEventRouterFactory* GetInstance();
@@ -146,18 +118,6 @@ class InputImeEventRouterFactory {
DISALLOW_COPY_AND_ASSIGN(InputImeEventRouterFactory);
};
-class InputImeKeyEventHandledFunction : public AsyncExtensionFunction {
- public:
- DECLARE_EXTENSION_FUNCTION("input.ime.keyEventHandled",
- INPUT_IME_KEYEVENTHANDLED)
-
- protected:
- ~InputImeKeyEventHandledFunction() override {}
-
- // ExtensionFunction:
- bool RunAsync() override;
-};
-
class InputImeAPI : public BrowserContextKeyedAPI,
public ExtensionRegistryObserver,
public EventRouter::Observer {

Powered by Google App Engine
This is Rietveld 408576698