Chromium Code Reviews| Index: chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h |
| diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h b/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h |
| index dd115ccf6e01aef97b32bb8771b625d7cf30705a..8dcaf6a6366b8bd57feef132bc0624fbbd0f0bb4 100644 |
| --- a/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h |
| +++ b/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h |
| @@ -138,6 +138,50 @@ class InputImeHideInputViewFunction : public AsyncExtensionFunction { |
| bool RunAsync() override; |
| }; |
| +class ExtensionRegistry; |
| +struct InputComponentInfo; |
| + |
| +class InputImeEventRouter { |
| + 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( |
|
Shu Chen
2016/01/05 15:10:48
I think AddRequest() and the request map logics ca
Devlin
2016/01/05 18:39:06
+1. The goal is to have these platform-specific f
Azure Wei
2016/01/06 06:53:47
Done. Added class InputImeEventRouterBase.
Azure Wei
2016/01/06 06:53:47
Done.
|
| + 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_; |
| + |
| + unsigned int next_request_id_; |
| + RequestMap request_map_; |
| + Profile* profile_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter); |
| +}; |
| + |
| } // namespace extensions |
| #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |