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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_STORAGE_SYSTEM_INFO_STORAGE_AP
I_H_ | 4 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_STORAGE_API_H_ |
5 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_STORAGE_SYSTEM_INFO_STORAGE_AP
I_H_ | 5 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_STORAGE_API_H_ |
6 | 6 |
7 #include "chrome/browser/extensions/api/system_info_storage/storage_info_provide
r.h" | 7 #include "chrome/browser/extensions/api/system_storage/storage_info_provider.h" |
8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
9 #include "chrome/browser/storage_monitor/storage_monitor.h" | 9 #include "chrome/browser/storage_monitor/storage_monitor.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 | 12 |
13 // Implementation of the systeminfo.storage.get API. It is an asynchronous | 13 // Implementation of the systeminfo.storage.get API. It is an asynchronous |
14 // call relative to browser UI thread. | 14 // call relative to browser UI thread. |
15 class SystemInfoStorageGetFunction : public AsyncExtensionFunction { | 15 class SystemStorageGetInfoFunction : public AsyncExtensionFunction { |
16 public: | 16 public: |
17 DECLARE_EXTENSION_FUNCTION("experimental.systemInfo.storage.get", | 17 DECLARE_EXTENSION_FUNCTION("system.storage.getInfo", SYSTEM_STORAGE_GETINFO); |
18 EXPERIMENTAL_SYSTEMINFO_STORAGE_GET) | 18 SystemStorageGetInfoFunction(); |
19 SystemInfoStorageGetFunction(); | |
20 | 19 |
21 private: | 20 private: |
22 virtual ~SystemInfoStorageGetFunction(); | 21 virtual ~SystemStorageGetInfoFunction(); |
23 virtual bool RunImpl() OVERRIDE; | 22 virtual bool RunImpl() OVERRIDE; |
24 | 23 |
25 void OnGetStorageInfoCompleted(bool success); | 24 void OnGetStorageInfoCompleted(bool success); |
26 }; | 25 }; |
27 | 26 |
28 class SystemInfoStorageEjectDeviceFunction | 27 class SystemStorageEjectDeviceFunction |
29 : public AsyncExtensionFunction { | 28 : public AsyncExtensionFunction { |
30 public: | 29 public: |
31 DECLARE_EXTENSION_FUNCTION("experimental.systemInfo.storage.ejectDevice", | 30 DECLARE_EXTENSION_FUNCTION("system.storage.ejectDevice", |
32 EXPERIMENTAL_SYSTEMINFO_STORAGE_EJECTDEVICE); | 31 SYSTEM_STORAGE_EJECTDEVICE); |
33 | 32 |
34 protected: | 33 protected: |
35 virtual ~SystemInfoStorageEjectDeviceFunction(); | 34 virtual ~SystemStorageEjectDeviceFunction(); |
36 | 35 |
37 // AsyncExtensionFunction overrides. | 36 // AsyncExtensionFunction overrides. |
38 virtual bool RunImpl() OVERRIDE; | 37 virtual bool RunImpl() OVERRIDE; |
39 | 38 |
40 private: | 39 private: |
41 void OnStorageMonitorInit(const std::string& transient_device_id); | 40 void OnStorageMonitorInit(const std::string& transient_device_id); |
42 | 41 |
43 // Eject device request handler. | 42 // Eject device request handler. |
44 void HandleResponse(chrome::StorageMonitor::EjectStatus status); | 43 void HandleResponse(chrome::StorageMonitor::EjectStatus status); |
45 }; | 44 }; |
46 | 45 |
47 class SystemInfoStorageAddWatchFunction : public AsyncExtensionFunction { | 46 class SystemStorageAddAvailableCapacityWatchFunction |
| 47 : public AsyncExtensionFunction { |
48 public: | 48 public: |
49 DECLARE_EXTENSION_FUNCTION("experimental.systemInfo.storage.addWatch", | 49 DECLARE_EXTENSION_FUNCTION("system.storage.addAvailableCapacityWatch", |
50 EXPERIMENTAL_SYSTEMINFO_STORAGE_ADDWATCH); | 50 SYSTEM_STORAGE_ADDAVAILABLECAPACITYWATCH); |
51 SystemInfoStorageAddWatchFunction(); | 51 SystemStorageAddAvailableCapacityWatchFunction(); |
52 | 52 |
53 private: | 53 private: |
54 virtual ~SystemInfoStorageAddWatchFunction(); | 54 virtual ~SystemStorageAddAvailableCapacityWatchFunction(); |
55 virtual bool RunImpl() OVERRIDE; | 55 virtual bool RunImpl() OVERRIDE; |
56 }; | 56 }; |
57 | 57 |
58 class SystemInfoStorageRemoveWatchFunction : public SyncExtensionFunction { | 58 class SystemStorageRemoveAvailableCapacityWatchFunction |
| 59 : public SyncExtensionFunction { |
59 public: | 60 public: |
60 DECLARE_EXTENSION_FUNCTION("experimental.systemInfo.storage.removeWatch", | 61 DECLARE_EXTENSION_FUNCTION("system.storage.removeAvailableCapacityWatch", |
61 EXPERIMENTAL_SYSTEMINFO_STORAGE_REMOVEWATCH); | 62 SYSTEM_STORAGE_REMOVEAVAILABLECAPACITYWATCH); |
62 SystemInfoStorageRemoveWatchFunction(); | 63 SystemStorageRemoveAvailableCapacityWatchFunction(); |
63 | 64 |
64 private: | 65 private: |
65 virtual ~SystemInfoStorageRemoveWatchFunction(); | 66 virtual ~SystemStorageRemoveAvailableCapacityWatchFunction(); |
66 virtual bool RunImpl() OVERRIDE; | 67 virtual bool RunImpl() OVERRIDE; |
67 }; | 68 }; |
68 | 69 |
69 class SystemInfoStorageGetAllWatchFunction : public SyncExtensionFunction { | 70 class SystemStorageGetAllAvailableCapacityWatchesFunction |
| 71 : public SyncExtensionFunction { |
70 public: | 72 public: |
71 DECLARE_EXTENSION_FUNCTION("experimental.systemInfo.storage.getAllWatch", | 73 DECLARE_EXTENSION_FUNCTION("system.storage.getAllAvailableCapacityWatches", |
72 EXPERIMENTAL_SYSTEMINFO_STORAGE_GETALLWATCH); | 74 SYSTEM_STORAGE_GETALLAVAILABLECAPACITYWATCHES); |
73 SystemInfoStorageGetAllWatchFunction(); | 75 SystemStorageGetAllAvailableCapacityWatchesFunction(); |
74 | 76 |
75 private: | 77 private: |
76 virtual ~SystemInfoStorageGetAllWatchFunction(); | 78 virtual ~SystemStorageGetAllAvailableCapacityWatchesFunction(); |
77 virtual bool RunImpl() OVERRIDE; | 79 virtual bool RunImpl() OVERRIDE; |
78 }; | 80 }; |
79 | 81 |
80 class SystemInfoStorageRemoveAllWatchFunction : public SyncExtensionFunction { | 82 class SystemStorageRemoveAllAvailableCapacityWatchesFunction |
| 83 : public SyncExtensionFunction { |
81 public: | 84 public: |
82 DECLARE_EXTENSION_FUNCTION("experimental.systemInfo.storage.removeAllWatch", | 85 DECLARE_EXTENSION_FUNCTION("system.storage.removeAllAvailableCapacityWatches", |
83 EXPERIMENTAL_SYSTEMINFO_STORAGE_REMOVEALLWATCH); | 86 SYSTEM_STORAGE_REMOVEALLAVAILABLECAPACITYWATCHES); |
84 SystemInfoStorageRemoveAllWatchFunction(); | 87 SystemStorageRemoveAllAvailableCapacityWatchesFunction(); |
85 | 88 |
86 private: | 89 private: |
87 virtual ~SystemInfoStorageRemoveAllWatchFunction(); | 90 virtual ~SystemStorageRemoveAllAvailableCapacityWatchesFunction(); |
88 virtual bool RunImpl() OVERRIDE; | 91 virtual bool RunImpl() OVERRIDE; |
89 }; | 92 }; |
90 | 93 |
91 } // namespace extensions | 94 } // namespace extensions |
92 | 95 |
93 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_STORAGE_SYSTEM_INFO_STORAGE
_API_H_ | 96 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_STORAGE_API_H_ |
OLD | NEW |