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 |
(...skipping 18 matching lines...) Expand all Loading... |
30 DECLARE_EXTENSION_FUNCTION("virtualKeyboardPrivate.moveCursor", | 30 DECLARE_EXTENSION_FUNCTION("virtualKeyboardPrivate.moveCursor", |
31 VIRTUALKEYBOARDPRIVATE_MOVECURSOR); | 31 VIRTUALKEYBOARDPRIVATE_MOVECURSOR); |
32 | 32 |
33 protected: | 33 protected: |
34 virtual ~MoveCursorFunction() {} | 34 virtual ~MoveCursorFunction() {} |
35 | 35 |
36 // ExtensionFunction. | 36 // ExtensionFunction. |
37 virtual bool RunImpl() OVERRIDE; | 37 virtual bool RunImpl() OVERRIDE; |
38 }; | 38 }; |
39 | 39 |
| 40 class SendKeyEventFunction : public SyncExtensionFunction { |
| 41 public: |
| 42 DECLARE_EXTENSION_FUNCTION( |
| 43 "virtualKeyboardPrivate.sendKeyEvent", |
| 44 VIRTUALKEYBOARDPRIVATE_SENDKEYEVENT); |
| 45 |
| 46 protected: |
| 47 virtual ~SendKeyEventFunction() {} |
| 48 |
| 49 // ExtensionFunction: |
| 50 virtual bool RunImpl() OVERRIDE; |
| 51 }; |
| 52 |
40 class InputAPI : public ProfileKeyedAPI { | 53 class InputAPI : public ProfileKeyedAPI { |
41 public: | 54 public: |
42 explicit InputAPI(Profile* profile); | 55 explicit InputAPI(Profile* profile); |
43 virtual ~InputAPI(); | 56 virtual ~InputAPI(); |
44 | 57 |
45 // ProfileKeyedAPI implementation. | 58 // ProfileKeyedAPI implementation. |
46 static ProfileKeyedAPIFactory<InputAPI>* GetFactoryInstance(); | 59 static ProfileKeyedAPIFactory<InputAPI>* GetFactoryInstance(); |
47 | 60 |
48 private: | 61 private: |
49 friend class ProfileKeyedAPIFactory<InputAPI>; | 62 friend class ProfileKeyedAPIFactory<InputAPI>; |
50 | 63 |
51 // ProfileKeyedAPI implementation. | 64 // ProfileKeyedAPI implementation. |
52 static const char* service_name() { | 65 static const char* service_name() { |
53 return "InputAPI"; | 66 return "InputAPI"; |
54 } | 67 } |
55 static const bool kServiceIsNULLWhileTesting = true; | 68 static const bool kServiceIsNULLWhileTesting = true; |
56 }; | 69 }; |
57 | 70 |
58 } // namespace extensions | 71 } // namespace extensions |
59 | 72 |
60 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ | 73 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ |
OLD | NEW |