| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 DECLARE_EXTENSION_FUNCTION("input.ime.keyEventHandled", | 121 DECLARE_EXTENSION_FUNCTION("input.ime.keyEventHandled", |
| 122 INPUT_IME_KEYEVENTHANDLED) | 122 INPUT_IME_KEYEVENTHANDLED) |
| 123 | 123 |
| 124 protected: | 124 protected: |
| 125 ~InputImeKeyEventHandledFunction() override {} | 125 ~InputImeKeyEventHandledFunction() override {} |
| 126 | 126 |
| 127 // ExtensionFunction: | 127 // ExtensionFunction: |
| 128 bool RunAsync() override; | 128 bool RunAsync() override; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 class InputImeSetCompositionFunction : public UIThreadExtensionFunction { |
| 132 public: |
| 133 DECLARE_EXTENSION_FUNCTION("input.ime.setComposition", |
| 134 INPUT_IME_SETCOMPOSITION) |
| 135 |
| 136 protected: |
| 137 ~InputImeSetCompositionFunction() override {} |
| 138 |
| 139 // UIThreadExtensionFunction: |
| 140 ResponseAction Run() override; |
| 141 }; |
| 142 |
| 143 class InputImeCommitTextFunction : public UIThreadExtensionFunction { |
| 144 public: |
| 145 DECLARE_EXTENSION_FUNCTION("input.ime.commitText", INPUT_IME_COMMITTEXT) |
| 146 |
| 147 protected: |
| 148 ~InputImeCommitTextFunction() override {} |
| 149 |
| 150 // UIThreadExtensionFunction: |
| 151 ResponseAction Run() override; |
| 152 }; |
| 153 |
| 131 class InputImeAPI : public BrowserContextKeyedAPI, | 154 class InputImeAPI : public BrowserContextKeyedAPI, |
| 132 public ExtensionRegistryObserver, | 155 public ExtensionRegistryObserver, |
| 133 public EventRouter::Observer { | 156 public EventRouter::Observer { |
| 134 public: | 157 public: |
| 135 explicit InputImeAPI(content::BrowserContext* context); | 158 explicit InputImeAPI(content::BrowserContext* context); |
| 136 ~InputImeAPI() override; | 159 ~InputImeAPI() override; |
| 137 | 160 |
| 138 // BrowserContextKeyedAPI implementation. | 161 // BrowserContextKeyedAPI implementation. |
| 139 static BrowserContextKeyedAPIFactory<InputImeAPI>* GetFactoryInstance(); | 162 static BrowserContextKeyedAPIFactory<InputImeAPI>* GetFactoryInstance(); |
| 140 | 163 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 163 // Listen to extension load, unloaded notifications. | 186 // Listen to extension load, unloaded notifications. |
| 164 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 187 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 165 extension_registry_observer_; | 188 extension_registry_observer_; |
| 166 }; | 189 }; |
| 167 | 190 |
| 168 InputImeEventRouter* GetInputImeEventRouter(Profile* profile); | 191 InputImeEventRouter* GetInputImeEventRouter(Profile* profile); |
| 169 | 192 |
| 170 } // namespace extensions | 193 } // namespace extensions |
| 171 | 194 |
| 172 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ | 195 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
| OLD | NEW |