OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_INPUT_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
10 #include "chrome/browser/extensions/extension_function.h" | 10 #include "chrome/browser/extensions/extension_function.h" |
11 | 11 |
12 class Profile; | 12 class Profile; |
13 | 13 |
14 namespace extensions { | 14 namespace extensions { |
15 | 15 |
16 class InsertTextInputFunction : public SyncExtensionFunction { | 16 class InsertTextInputFunction : public SyncExtensionFunction { |
17 public: | 17 public: |
18 DECLARE_EXTENSION_FUNCTION( | 18 DECLARE_EXTENSION_FUNCTION( |
19 "experimental.input.virtualKeyboard.insertText", | 19 "experimental.input.virtualKeyboard.insertText", |
20 EXPERIMENTAL_INPUT_VIRTUALKEYBOARD_INSERTTEXT); | 20 EXPERIMENTAL_INPUT_VIRTUALKEYBOARD_INSERTTEXT); |
21 | 21 |
22 protected: | 22 protected: |
23 virtual ~InsertTextInputFunction() {} | 23 virtual ~InsertTextInputFunction() {} |
24 | 24 |
25 // ExtensionFunction: | 25 // ExtensionFunction: |
26 virtual bool RunImpl() OVERRIDE; | 26 virtual bool RunImpl() OVERRIDE; |
27 }; | 27 }; |
28 | 28 |
| 29 class DispatchKeyEventFunction : public SyncExtensionFunction { |
| 30 public: |
| 31 DECLARE_EXTENSION_FUNCTION( |
| 32 "experimental.input.virtualKeyboard.dispatchKeyEvent", |
| 33 EXPERIMENTAL_INPUT_VIRTUALKEYBOARD_DISPATCHKEYEVENT); |
| 34 |
| 35 protected: |
| 36 virtual ~DispatchKeyEventFunction() {} |
| 37 |
| 38 // ExtensionFunction: |
| 39 virtual bool RunImpl() OVERRIDE; |
| 40 }; |
| 41 |
29 class InputAPI : public ProfileKeyedAPI { | 42 class InputAPI : public ProfileKeyedAPI { |
30 public: | 43 public: |
31 explicit InputAPI(Profile* profile); | 44 explicit InputAPI(Profile* profile); |
32 virtual ~InputAPI(); | 45 virtual ~InputAPI(); |
33 | 46 |
34 // ProfileKeyedAPI implementation. | 47 // ProfileKeyedAPI implementation. |
35 static ProfileKeyedAPIFactory<InputAPI>* GetFactoryInstance(); | 48 static ProfileKeyedAPIFactory<InputAPI>* GetFactoryInstance(); |
36 | 49 |
37 private: | 50 private: |
38 friend class ProfileKeyedAPIFactory<InputAPI>; | 51 friend class ProfileKeyedAPIFactory<InputAPI>; |
39 | 52 |
40 // ProfileKeyedAPI implementation. | 53 // ProfileKeyedAPI implementation. |
41 static const char* service_name() { | 54 static const char* service_name() { |
42 return "InputAPI"; | 55 return "InputAPI"; |
43 } | 56 } |
44 static const bool kServiceIsNULLWhileTesting = true; | 57 static const bool kServiceIsNULLWhileTesting = true; |
45 }; | 58 }; |
46 | 59 |
47 } // namespace extensions | 60 } // namespace extensions |
48 | 61 |
49 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ | 62 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ |
OLD | NEW |