• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_
7 
8 #include "base/compiler_specific.h"
9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
10 #include "extensions/browser/extension_function.h"
11 
12 class Profile;
13 
14 namespace extensions {
15 
16 class VirtualKeyboardPrivateInsertTextFunction : public SyncExtensionFunction {
17  public:
18   DECLARE_EXTENSION_FUNCTION("virtualKeyboardPrivate.insertText",
19                              VIRTUALKEYBOARDPRIVATE_INSERTTEXT);
20 
21  protected:
~VirtualKeyboardPrivateInsertTextFunction()22   virtual ~VirtualKeyboardPrivateInsertTextFunction() {}
23 
24   // ExtensionFunction:
25   virtual bool RunImpl() OVERRIDE;
26 };
27 
28 class VirtualKeyboardPrivateMoveCursorFunction : public SyncExtensionFunction {
29  public:
30   DECLARE_EXTENSION_FUNCTION("virtualKeyboardPrivate.moveCursor",
31                              VIRTUALKEYBOARDPRIVATE_MOVECURSOR);
32 
33  protected:
~VirtualKeyboardPrivateMoveCursorFunction()34   virtual ~VirtualKeyboardPrivateMoveCursorFunction() {}
35 
36   // ExtensionFunction.
37   virtual bool RunImpl() OVERRIDE;
38 };
39 
40 class VirtualKeyboardPrivateSendKeyEventFunction
41     : public SyncExtensionFunction {
42  public:
43   DECLARE_EXTENSION_FUNCTION(
44       "virtualKeyboardPrivate.sendKeyEvent",
45       VIRTUALKEYBOARDPRIVATE_SENDKEYEVENT);
46 
47  protected:
~VirtualKeyboardPrivateSendKeyEventFunction()48   virtual ~VirtualKeyboardPrivateSendKeyEventFunction() {}
49 
50   // ExtensionFunction:
51   virtual bool RunImpl() OVERRIDE;
52 };
53 
54 class VirtualKeyboardPrivateHideKeyboardFunction
55     : public SyncExtensionFunction {
56  public:
57   DECLARE_EXTENSION_FUNCTION(
58       "virtualKeyboardPrivate.hideKeyboard",
59       VIRTUALKEYBOARDPRIVATE_HIDEKEYBOARD);
60 
61  protected:
~VirtualKeyboardPrivateHideKeyboardFunction()62   virtual ~VirtualKeyboardPrivateHideKeyboardFunction() {}
63 
64   // ExtensionFunction:
65   virtual bool RunImpl() OVERRIDE;
66 };
67 
68 class VirtualKeyboardPrivateLockKeyboardFunction
69     : public SyncExtensionFunction {
70  public:
71   DECLARE_EXTENSION_FUNCTION(
72       "virtualKeyboardPrivate.lockKeyboard",
73       VIRTUALKEYBOARDPRIVATE_LOCKKEYBOARD);
74 
75  protected:
~VirtualKeyboardPrivateLockKeyboardFunction()76   virtual ~VirtualKeyboardPrivateLockKeyboardFunction() {}
77 
78   // ExtensionFunction:
79   virtual bool RunImpl() OVERRIDE;
80 };
81 
82 class VirtualKeyboardPrivateKeyboardLoadedFunction
83     : public SyncExtensionFunction {
84  public:
85   DECLARE_EXTENSION_FUNCTION(
86       "virtualKeyboardPrivate.keyboardLoaded",
87       VIRTUALKEYBOARDPRIVATE_KEYBOARDLOADED);
88 
89  protected:
~VirtualKeyboardPrivateKeyboardLoadedFunction()90   virtual ~VirtualKeyboardPrivateKeyboardLoadedFunction() {}
91 
92   // ExtensionFunction:
93   virtual bool RunImpl() OVERRIDE;
94 };
95 
96 class InputAPI : public ProfileKeyedAPI {
97  public:
98   explicit InputAPI(Profile* profile);
99   virtual ~InputAPI();
100 
101   // ProfileKeyedAPI implementation.
102   static ProfileKeyedAPIFactory<InputAPI>* GetFactoryInstance();
103 
104  private:
105   friend class ProfileKeyedAPIFactory<InputAPI>;
106 
107   // ProfileKeyedAPI implementation.
service_name()108   static const char* service_name() {
109     return "InputAPI";
110   }
111   static const bool kServiceIsNULLWhileTesting = true;
112 };
113 
114 }  // namespace extensions
115 
116 #endif  // CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_
117