Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Side by Side Diff: chrome/browser/extensions/api/input_ime/input_ime_api.h

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 class InputImeKeyEventHandledFunction : public AsyncExtensionFunction { 186 class InputImeKeyEventHandledFunction : public AsyncExtensionFunction {
187 public: 187 public:
188 DECLARE_EXTENSION_FUNCTION("input.ime.keyEventHandled", 188 DECLARE_EXTENSION_FUNCTION("input.ime.keyEventHandled",
189 INPUT_IME_KEYEVENTHANDLED) 189 INPUT_IME_KEYEVENTHANDLED)
190 190
191 protected: 191 protected:
192 virtual ~InputImeKeyEventHandledFunction() {} 192 virtual ~InputImeKeyEventHandledFunction() {}
193 193
194 // ExtensionFunction: 194 // ExtensionFunction:
195 virtual bool RunImpl() OVERRIDE; 195 virtual bool RunAsync() OVERRIDE;
196 }; 196 };
197 197
198 class InputImeSendKeyEventsFunction : public AsyncExtensionFunction { 198 class InputImeSendKeyEventsFunction : public AsyncExtensionFunction {
199 public: 199 public:
200 DECLARE_EXTENSION_FUNCTION("input.ime.sendKeyEvents", 200 DECLARE_EXTENSION_FUNCTION("input.ime.sendKeyEvents",
201 INPUT_IME_SENDKEYEVENTS) 201 INPUT_IME_SENDKEYEVENTS)
202 202
203 protected: 203 protected:
204 virtual ~InputImeSendKeyEventsFunction() {} 204 virtual ~InputImeSendKeyEventsFunction() {}
205 205
206 // ExtensionFunction: 206 // ExtensionFunction:
207 virtual bool RunImpl() OVERRIDE; 207 virtual bool RunAsync() OVERRIDE;
208 }; 208 };
209 209
210 class InputImeHideInputViewFunction : public AsyncExtensionFunction { 210 class InputImeHideInputViewFunction : public AsyncExtensionFunction {
211 public: 211 public:
212 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", 212 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView",
213 INPUT_IME_HIDEINPUTVIEW) 213 INPUT_IME_HIDEINPUTVIEW)
214 214
215 protected: 215 protected:
216 virtual ~InputImeHideInputViewFunction() {} 216 virtual ~InputImeHideInputViewFunction() {}
217 217
218 // ExtensionFunction: 218 // ExtensionFunction:
219 virtual bool RunImpl() OVERRIDE; 219 virtual bool RunAsync() OVERRIDE;
220 }; 220 };
221 221
222 class InputImeAPI : public BrowserContextKeyedAPI, 222 class InputImeAPI : public BrowserContextKeyedAPI,
223 public ExtensionRegistryObserver, 223 public ExtensionRegistryObserver,
224 public EventRouter::Observer { 224 public EventRouter::Observer {
225 public: 225 public:
226 explicit InputImeAPI(content::BrowserContext* context); 226 explicit InputImeAPI(content::BrowserContext* context);
227 virtual ~InputImeAPI(); 227 virtual ~InputImeAPI();
228 228
229 // BrowserContextKeyedAPI implementation. 229 // BrowserContextKeyedAPI implementation.
(...skipping 23 matching lines...) Expand all
253 content::BrowserContext* const browser_context_; 253 content::BrowserContext* const browser_context_;
254 254
255 // Listen to extension load, unloaded notifications. 255 // Listen to extension load, unloaded notifications.
256 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> 256 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
257 extension_registry_observer_; 257 extension_registry_observer_;
258 }; 258 };
259 259
260 } // namespace extensions 260 } // namespace extensions
261 261
262 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ 262 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698