Chromium Code Reviews| 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 { |
| 17 class InputImeEventRouterBase; | |
|
Devlin
2016/01/11 22:18:57
you include the header, so no need for this.
Azure Wei
2016/01/12 01:55:53
Done.
| |
| 18 struct InputComponentInfo; | |
| 11 | 19 |
| 12 class InputImeSetCompositionFunction : public SyncExtensionFunction { | 20 class InputImeSetCompositionFunction : public SyncExtensionFunction { |
| 13 public: | 21 public: |
| 14 DECLARE_EXTENSION_FUNCTION("input.ime.setComposition", | 22 DECLARE_EXTENSION_FUNCTION("input.ime.setComposition", |
| 15 INPUT_IME_SETCOMPOSITION) | 23 INPUT_IME_SETCOMPOSITION) |
| 16 | 24 |
| 17 protected: | 25 protected: |
| 18 ~InputImeSetCompositionFunction() override {} | 26 ~InputImeSetCompositionFunction() override {} |
| 19 | 27 |
| 20 // ExtensionFunction: | 28 // ExtensionFunction: |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", | 139 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", |
| 132 INPUT_IME_HIDEINPUTVIEW) | 140 INPUT_IME_HIDEINPUTVIEW) |
| 133 | 141 |
| 134 protected: | 142 protected: |
| 135 ~InputImeHideInputViewFunction() override {} | 143 ~InputImeHideInputViewFunction() override {} |
| 136 | 144 |
| 137 // ExtensionFunction: | 145 // ExtensionFunction: |
| 138 bool RunAsync() override; | 146 bool RunAsync() override; |
| 139 }; | 147 }; |
| 140 | 148 |
| 149 class InputImeEventRouter : public InputImeEventRouterBase { | |
| 150 public: | |
| 151 explicit InputImeEventRouter(Profile* profile); | |
| 152 ~InputImeEventRouter() override; | |
| 153 | |
| 154 bool RegisterImeExtension( | |
| 155 const std::string& extension_id, | |
| 156 const std::vector<extensions::InputComponentInfo>& input_components); | |
| 157 void UnregisterAllImes(const std::string& extension_id); | |
| 158 | |
| 159 ui::IMEEngineHandlerInterface* GetEngine(const std::string& extension_id, | |
| 160 const std::string& component_id); | |
| 161 ui::IMEEngineHandlerInterface* GetActiveEngine( | |
| 162 const std::string& extension_id); | |
| 163 | |
| 164 private: | |
| 165 // The engine map from extension_id to an engine. | |
| 166 std::map<std::string, ui::IMEEngineHandlerInterface*> engine_map_; | |
| 167 | |
| 168 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter); | |
| 169 }; | |
| 170 | |
| 141 } // namespace extensions | 171 } // namespace extensions |
| 142 | 172 |
| 143 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ | 173 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |
| OLD | NEW |