Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / api / autotest_private / autotest_private_api.h
blob089a02333a4a8cf5c2467b6cc26855d9345eb524
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "chrome/browser/extensions/chrome_extension_function.h"
12 #include "extensions/browser/browser_context_keyed_api_factory.h"
14 namespace extensions {
16 class AutotestPrivateLogoutFunction : public ChromeSyncExtensionFunction {
17 public:
18 DECLARE_EXTENSION_FUNCTION("autotestPrivate.logout", AUTOTESTPRIVATE_LOGOUT)
20 private:
21 ~AutotestPrivateLogoutFunction() override {}
22 bool RunSync() override;
25 class AutotestPrivateRestartFunction : public ChromeSyncExtensionFunction {
26 public:
27 DECLARE_EXTENSION_FUNCTION("autotestPrivate.restart", AUTOTESTPRIVATE_RESTART)
29 private:
30 ~AutotestPrivateRestartFunction() override {}
31 bool RunSync() override;
34 class AutotestPrivateShutdownFunction : public ChromeSyncExtensionFunction {
35 public:
36 DECLARE_EXTENSION_FUNCTION("autotestPrivate.shutdown",
37 AUTOTESTPRIVATE_SHUTDOWN)
39 private:
40 ~AutotestPrivateShutdownFunction() override {}
41 bool RunSync() override;
44 class AutotestPrivateLoginStatusFunction : public ChromeSyncExtensionFunction {
45 public:
46 DECLARE_EXTENSION_FUNCTION("autotestPrivate.loginStatus",
47 AUTOTESTPRIVATE_LOGINSTATUS)
49 private:
50 ~AutotestPrivateLoginStatusFunction() override {}
51 bool RunSync() override;
54 class AutotestPrivateLockScreenFunction : public ChromeSyncExtensionFunction {
55 public:
56 DECLARE_EXTENSION_FUNCTION("autotestPrivate.lockScreen",
57 AUTOTESTPRIVATE_LOCKSCREEN)
59 private:
60 ~AutotestPrivateLockScreenFunction() override {}
61 bool RunSync() override;
64 class AutotestPrivateGetExtensionsInfoFunction
65 : public ChromeSyncExtensionFunction {
66 public:
67 DECLARE_EXTENSION_FUNCTION("autotestPrivate.getExtensionsInfo",
68 AUTOTESTPRIVATE_GETEXTENSIONSINFO)
70 private:
71 ~AutotestPrivateGetExtensionsInfoFunction() override {}
72 bool RunSync() override;
75 class AutotestPrivateSimulateAsanMemoryBugFunction
76 : public ChromeSyncExtensionFunction {
77 public:
78 DECLARE_EXTENSION_FUNCTION("autotestPrivate.simulateAsanMemoryBug",
79 AUTOTESTPRIVATE_SIMULATEASANMEMORYBUG)
81 private:
82 ~AutotestPrivateSimulateAsanMemoryBugFunction() override {}
83 bool RunSync() override;
86 class AutotestPrivateSetTouchpadSensitivityFunction
87 : public ChromeSyncExtensionFunction {
88 public:
89 DECLARE_EXTENSION_FUNCTION("autotestPrivate.setTouchpadSensitivity",
90 AUTOTESTPRIVATE_SETTOUCHPADSENSITIVITY)
92 private:
93 ~AutotestPrivateSetTouchpadSensitivityFunction() override {}
94 bool RunSync() override;
97 class AutotestPrivateSetTapToClickFunction
98 : public ChromeSyncExtensionFunction {
99 public:
100 DECLARE_EXTENSION_FUNCTION("autotestPrivate.setTapToClick",
101 AUTOTESTPRIVATE_SETTAPTOCLICK)
103 private:
104 ~AutotestPrivateSetTapToClickFunction() override {}
105 bool RunSync() override;
108 class AutotestPrivateSetThreeFingerClickFunction
109 : public ChromeSyncExtensionFunction {
110 public:
111 DECLARE_EXTENSION_FUNCTION("autotestPrivate.setThreeFingerClick",
112 AUTOTESTPRIVATE_SETTHREEFINGERCLICK)
114 private:
115 ~AutotestPrivateSetThreeFingerClickFunction() override {}
116 bool RunSync() override;
119 class AutotestPrivateSetTapDraggingFunction
120 : public ChromeSyncExtensionFunction {
121 public:
122 DECLARE_EXTENSION_FUNCTION("autotestPrivate.setTapDragging",
123 AUTOTESTPRIVATE_SETTAPDRAGGING)
125 private:
126 ~AutotestPrivateSetTapDraggingFunction() override {}
127 bool RunSync() override;
130 class AutotestPrivateSetNaturalScrollFunction
131 : public ChromeSyncExtensionFunction {
132 public:
133 DECLARE_EXTENSION_FUNCTION("autotestPrivate.setNaturalScroll",
134 AUTOTESTPRIVATE_SETNATURALSCROLL)
136 private:
137 ~AutotestPrivateSetNaturalScrollFunction() override {}
138 bool RunSync() override;
141 class AutotestPrivateSetMouseSensitivityFunction
142 : public ChromeSyncExtensionFunction {
143 public:
144 DECLARE_EXTENSION_FUNCTION("autotestPrivate.setMouseSensitivity",
145 AUTOTESTPRIVATE_SETMOUSESENSITIVITY)
147 private:
148 ~AutotestPrivateSetMouseSensitivityFunction() override {}
149 bool RunSync() override;
152 class AutotestPrivateSetPrimaryButtonRightFunction
153 : public ChromeSyncExtensionFunction {
154 public:
155 DECLARE_EXTENSION_FUNCTION("autotestPrivate.setPrimaryButtonRight",
156 AUTOTESTPRIVATE_SETPRIMARYBUTTONRIGHT)
158 private:
159 ~AutotestPrivateSetPrimaryButtonRightFunction() override {}
160 bool RunSync() override;
163 // Don't kill the browser when we're in a browser test.
164 void SetAutotestPrivateTest();
166 // The profile-keyed service that manages the autotestPrivate extension API.
167 class AutotestPrivateAPI : public BrowserContextKeyedAPI {
168 public:
169 static BrowserContextKeyedAPIFactory<AutotestPrivateAPI>*
170 GetFactoryInstance();
172 // TODO(achuith): Replace these with a mock object for system calls.
173 bool test_mode() const { return test_mode_; }
174 void set_test_mode(bool test_mode) { test_mode_ = test_mode; }
176 private:
177 friend class BrowserContextKeyedAPIFactory<AutotestPrivateAPI>;
179 AutotestPrivateAPI();
180 ~AutotestPrivateAPI() override;
182 // BrowserContextKeyedAPI implementation.
183 static const char* service_name() { return "AutotestPrivateAPI"; }
184 static const bool kServiceIsNULLWhileTesting = true;
185 static const bool kServiceRedirectedInIncognito = true;
187 bool test_mode_; // true for ExtensionApiTest.AutotestPrivate browser test.
190 template <>
191 KeyedService*
192 BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor(
193 content::BrowserContext* context) const;
195 } // namespace extensions
197 #endif // CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_