OLD | NEW |
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 // This extension API contains system-wide preferences and functions that shall | 5 // This extension API contains system-wide preferences and functions that shall |
6 // be only available to component extensions. | 6 // be only available to component extensions. |
7 | 7 |
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_PRIVATE_SYSTEM_PRIVATE_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_PRIVATE_SYSTEM_PRIVATE_API_H_ |
9 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_PRIVATE_SYSTEM_PRIVATE_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_PRIVATE_SYSTEM_PRIVATE_API_H_ |
10 | 10 |
11 #include "chrome/browser/extensions/chrome_extension_function.h" | 11 #include "extensions/browser/extension_function.h" |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
15 class SystemPrivateGetIncognitoModeAvailabilityFunction | 15 class SystemPrivateGetIncognitoModeAvailabilityFunction |
16 : public ChromeSyncExtensionFunction { | 16 : public UIThreadExtensionFunction { |
17 public: | 17 public: |
18 DECLARE_EXTENSION_FUNCTION("systemPrivate.getIncognitoModeAvailability", | 18 DECLARE_EXTENSION_FUNCTION("systemPrivate.getIncognitoModeAvailability", |
19 SYSTEMPRIVATE_GETINCOGNITOMODEAVAILABILITY) | 19 SYSTEMPRIVATE_GETINCOGNITOMODEAVAILABILITY) |
20 | 20 |
21 protected: | 21 protected: |
22 ~SystemPrivateGetIncognitoModeAvailabilityFunction() override {} | 22 ~SystemPrivateGetIncognitoModeAvailabilityFunction() override {} |
23 | 23 |
24 // ExtensionFunction: | 24 // ExtensionFunction: |
25 bool RunSync() override; | 25 ResponseAction Run() override; |
26 }; | 26 }; |
27 | 27 |
28 // API function which returns the status of system update. | 28 // API function which returns the status of system update. |
29 class SystemPrivateGetUpdateStatusFunction | 29 class SystemPrivateGetUpdateStatusFunction : public UIThreadExtensionFunction { |
30 : public ChromeSyncExtensionFunction { | |
31 public: | 30 public: |
32 DECLARE_EXTENSION_FUNCTION("systemPrivate.getUpdateStatus", | 31 DECLARE_EXTENSION_FUNCTION("systemPrivate.getUpdateStatus", |
33 SYSTEMPRIVATE_GETUPDATESTATUS) | 32 SYSTEMPRIVATE_GETUPDATESTATUS) |
34 | 33 |
35 protected: | 34 protected: |
36 ~SystemPrivateGetUpdateStatusFunction() override {} | 35 ~SystemPrivateGetUpdateStatusFunction() override {} |
37 | 36 |
38 // ExtensionFunction: | 37 // ExtensionFunction: |
39 bool RunSync() override; | 38 ResponseAction Run() override; |
40 }; | 39 }; |
41 | 40 |
42 // API function which returns the Google API key. | 41 // API function which returns the Google API key. |
43 class SystemPrivateGetApiKeyFunction : public SyncExtensionFunction { | 42 class SystemPrivateGetApiKeyFunction : public UIThreadExtensionFunction { |
44 public: | 43 public: |
45 DECLARE_EXTENSION_FUNCTION("systemPrivate.getApiKey", SYSTEMPRIVATE_GETAPIKEY) | 44 DECLARE_EXTENSION_FUNCTION("systemPrivate.getApiKey", SYSTEMPRIVATE_GETAPIKEY) |
46 | 45 |
47 protected: | 46 protected: |
48 ~SystemPrivateGetApiKeyFunction() override {} | 47 ~SystemPrivateGetApiKeyFunction() override {} |
49 | 48 |
50 // ExtensionFunction: | 49 // ExtensionFunction: |
51 bool RunSync() override; | 50 ResponseAction Run() override; |
52 }; | 51 }; |
53 | 52 |
54 // Dispatches systemPrivate.onBrightnessChanged event for extensions. | 53 // Dispatches systemPrivate.onBrightnessChanged event for extensions. |
55 void DispatchBrightnessChangedEvent(int brightness, bool user_initiated); | 54 void DispatchBrightnessChangedEvent(int brightness, bool user_initiated); |
56 | 55 |
57 // Dispatches systemPrivate.onVolumeChanged event for extensions. | 56 // Dispatches systemPrivate.onVolumeChanged event for extensions. |
58 void DispatchVolumeChangedEvent(double volume, bool is_volume_muted); | 57 void DispatchVolumeChangedEvent(double volume, bool is_volume_muted); |
59 | 58 |
60 // Dispatches systemPrivate.onScreenChanged event for extensions. | 59 // Dispatches systemPrivate.onScreenChanged event for extensions. |
61 void DispatchScreenUnlockedEvent(); | 60 void DispatchScreenUnlockedEvent(); |
62 | 61 |
63 // Dispatches systemPrivate.onWokeUp event for extensions. | 62 // Dispatches systemPrivate.onWokeUp event for extensions. |
64 void DispatchWokeUpEvent(); | 63 void DispatchWokeUpEvent(); |
65 | 64 |
66 } // namespace extensions | 65 } // namespace extensions |
67 | 66 |
68 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_PRIVATE_SYSTEM_PRIVATE_API_H_ | 67 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_PRIVATE_SYSTEM_PRIVATE_API_H_ |
OLD | NEW |