| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h" |
| 13 #include "chrome/common/extensions/api/input_ime/input_components_handler.h" |
| 8 #include "extensions/browser/extension_function.h" | 14 #include "extensions/browser/extension_function.h" |
| 9 | 15 |
| 10 namespace extensions { | 16 namespace extensions { |
| 11 | 17 |
| 12 class InputImeSetCompositionFunction : public SyncExtensionFunction { | 18 class InputImeSetCompositionFunction : public SyncExtensionFunction { |
| 13 public: | 19 public: |
| 14 DECLARE_EXTENSION_FUNCTION("input.ime.setComposition", | 20 DECLARE_EXTENSION_FUNCTION("input.ime.setComposition", |
| 15 INPUT_IME_SETCOMPOSITION) | 21 INPUT_IME_SETCOMPOSITION) |
| 16 | 22 |
| 17 protected: | 23 protected: |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", | 137 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", |
| 132 INPUT_IME_HIDEINPUTVIEW) | 138 INPUT_IME_HIDEINPUTVIEW) |
| 133 | 139 |
| 134 protected: | 140 protected: |
| 135 ~InputImeHideInputViewFunction() override {} | 141 ~InputImeHideInputViewFunction() override {} |
| 136 | 142 |
| 137 // ExtensionFunction: | 143 // ExtensionFunction: |
| 138 bool RunAsync() override; | 144 bool RunAsync() override; |
| 139 }; | 145 }; |
| 140 | 146 |
| 147 class InputImeEventRouter : public InputImeEventRouterBase { |
| 148 public: |
| 149 explicit InputImeEventRouter(Profile* profile); |
| 150 ~InputImeEventRouter() override; |
| 151 |
| 152 bool RegisterImeExtension( |
| 153 const std::string& extension_id, |
| 154 const std::vector<extensions::InputComponentInfo>& input_components); |
| 155 void UnregisterAllImes(const std::string& extension_id); |
| 156 |
| 157 ui::IMEEngineHandlerInterface* GetEngine(const std::string& extension_id, |
| 158 const std::string& component_id); |
| 159 ui::IMEEngineHandlerInterface* GetActiveEngine( |
| 160 const std::string& extension_id); |
| 161 |
| 162 private: |
| 163 // The engine map from extension_id to an engine. |
| 164 std::map<std::string, ui::IMEEngineHandlerInterface*> engine_map_; |
| 165 |
| 166 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter); |
| 167 }; |
| 168 |
| 141 } // namespace extensions | 169 } // namespace extensions |
| 142 | 170 |
| 143 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ | 171 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |
| OLD | NEW |