| 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 |
| 10 #include "chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h" |
| 11 #include "chrome/browser/profiles/profile.h" |
| 8 #include "extensions/browser/extension_function.h" | 12 #include "extensions/browser/extension_function.h" |
| 13 #include "ui/base/ime/ime_engine_handler_interface.h" |
| 14 |
| 15 class Profile; |
| 16 |
| 17 namespace ui { |
| 18 class IMEEngineHandlerInterface; |
| 19 } // namespace ui |
| 9 | 20 |
| 10 namespace extensions { | 21 namespace extensions { |
| 22 class InputImeEventRouterBase; |
| 23 struct InputComponentInfo; |
| 11 | 24 |
| 12 class InputImeSetCompositionFunction : public SyncExtensionFunction { | 25 class InputImeSetCompositionFunction : public SyncExtensionFunction { |
| 13 public: | 26 public: |
| 14 DECLARE_EXTENSION_FUNCTION("input.ime.setComposition", | 27 DECLARE_EXTENSION_FUNCTION("input.ime.setComposition", |
| 15 INPUT_IME_SETCOMPOSITION) | 28 INPUT_IME_SETCOMPOSITION) |
| 16 | 29 |
| 17 protected: | 30 protected: |
| 18 ~InputImeSetCompositionFunction() override {} | 31 ~InputImeSetCompositionFunction() override {} |
| 19 | 32 |
| 20 // ExtensionFunction: | 33 // ExtensionFunction: |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", | 144 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", |
| 132 INPUT_IME_HIDEINPUTVIEW) | 145 INPUT_IME_HIDEINPUTVIEW) |
| 133 | 146 |
| 134 protected: | 147 protected: |
| 135 ~InputImeHideInputViewFunction() override {} | 148 ~InputImeHideInputViewFunction() override {} |
| 136 | 149 |
| 137 // ExtensionFunction: | 150 // ExtensionFunction: |
| 138 bool RunAsync() override; | 151 bool RunAsync() override; |
| 139 }; | 152 }; |
| 140 | 153 |
| 154 class InputImeEventRouter : public InputImeEventRouterBase { |
| 155 public: |
| 156 explicit InputImeEventRouter(Profile* profile); |
| 157 ~InputImeEventRouter() override; |
| 158 |
| 159 bool RegisterImeExtension( |
| 160 const std::string& extension_id, |
| 161 const std::vector<extensions::InputComponentInfo>& input_components); |
| 162 void UnregisterAllImes(const std::string& extension_id); |
| 163 |
| 164 ui::IMEEngineHandlerInterface* GetEngine(const std::string& extension_id, |
| 165 const std::string& component_id); |
| 166 ui::IMEEngineHandlerInterface* GetActiveEngine( |
| 167 const std::string& extension_id); |
| 168 |
| 169 private: |
| 170 // The engine map from extension_id to an engine. |
| 171 std::map<std::string, ui::IMEEngineHandlerInterface*> engine_map_; |
| 172 |
| 173 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter); |
| 174 }; |
| 175 |
| 141 } // namespace extensions | 176 } // namespace extensions |
| 142 | 177 |
| 143 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ | 178 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |
| OLD | NEW |