Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_INFO_STORAGE_API_H_ | |
| 5 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_INFO_STORAGE_API_H_ | |
| 6 | |
| 7 #include "chrome/browser/extensions/api/system_storage/storage_info_provider.h" | |
| 8 #include "chrome/browser/extensions/extension_function.h" | |
| 9 #include "chrome/browser/storage_monitor/storage_monitor.h" | |
| 10 | |
| 11 namespace extensions { | |
|
not at google - send to devlin
2013/07/18 17:06:18
Is there any chance you can tell git/svn to make t
Haojian Wu
2013/07/19 08:47:12
Done.
| |
| 12 | |
| 13 // Implementation of the systeminfo.storage.get API. It is an asynchronous | |
| 14 // call relative to browser UI thread. | |
| 15 class SystemStorageGetFunction : public AsyncExtensionFunction { | |
| 16 public: | |
| 17 DECLARE_EXTENSION_FUNCTION("system.storage.get", SYSTEM_STORAGE_GET); | |
| 18 SystemStorageGetFunction(); | |
| 19 | |
| 20 private: | |
| 21 virtual ~SystemStorageGetFunction(); | |
| 22 virtual bool RunImpl() OVERRIDE; | |
| 23 | |
| 24 void OnGetStorageInfoCompleted(bool success); | |
| 25 }; | |
| 26 | |
| 27 class SystemStorageEjectDeviceFunction | |
| 28 : public AsyncExtensionFunction { | |
| 29 public: | |
| 30 DECLARE_EXTENSION_FUNCTION("system.storage.ejectDevice", | |
| 31 SYSTEM_STORAGE_EJECTDEVICE); | |
| 32 | |
| 33 protected: | |
| 34 virtual ~SystemStorageEjectDeviceFunction(); | |
| 35 | |
| 36 // AsyncExtensionFunction overrides. | |
| 37 virtual bool RunImpl() OVERRIDE; | |
| 38 | |
| 39 private: | |
| 40 void OnStorageMonitorInit(const std::string& transient_device_id); | |
| 41 | |
| 42 // Eject device request handler. | |
| 43 void HandleResponse(chrome::StorageMonitor::EjectStatus status); | |
| 44 }; | |
| 45 | |
| 46 class SystemStorageAddAvailableCapacityWatchFunction | |
| 47 : public AsyncExtensionFunction { | |
| 48 public: | |
| 49 DECLARE_EXTENSION_FUNCTION("system.storage.addAvailableCapacityWatch", | |
| 50 SYSTEM_STORAGE_ADDAVAILABLECAPACITYWATCH); | |
| 51 SystemStorageAddAvailableCapacityWatchFunction(); | |
| 52 | |
| 53 private: | |
| 54 virtual ~SystemStorageAddAvailableCapacityWatchFunction(); | |
| 55 virtual bool RunImpl() OVERRIDE; | |
| 56 }; | |
| 57 | |
| 58 class SystemStorageRemoveAvailableCapacityWatchFunction | |
| 59 : public SyncExtensionFunction { | |
| 60 public: | |
| 61 DECLARE_EXTENSION_FUNCTION("system.storage.removeAvailableCapacityWatch", | |
| 62 SYSTEM_STORAGE_REMOVEAVAILABLECAPACITYWATCH); | |
| 63 SystemStorageRemoveAvailableCapacityWatchFunction(); | |
| 64 | |
| 65 private: | |
| 66 virtual ~SystemStorageRemoveAvailableCapacityWatchFunction(); | |
| 67 virtual bool RunImpl() OVERRIDE; | |
| 68 }; | |
| 69 | |
| 70 class SystemStorageGetAllAvailableCapacityWatchesFunction | |
| 71 : public SyncExtensionFunction { | |
| 72 public: | |
| 73 DECLARE_EXTENSION_FUNCTION("system.storage.getAllAvailableCapacityWatches", | |
| 74 SYSTEM_STORAGE_GETALLAVAILABLECAPACITYWATCHES); | |
| 75 SystemStorageGetAllAvailableCapacityWatchesFunction(); | |
| 76 | |
| 77 private: | |
| 78 virtual ~SystemStorageGetAllAvailableCapacityWatchesFunction(); | |
| 79 virtual bool RunImpl() OVERRIDE; | |
| 80 }; | |
| 81 | |
| 82 class SystemStorageRemoveAllAvailableCapacityWatchesFunction | |
| 83 : public SyncExtensionFunction { | |
| 84 public: | |
| 85 DECLARE_EXTENSION_FUNCTION("system.storage.removeAllAvailableCapacityWatches", | |
| 86 SYSTEM_STORAGE_REMOVEALLAVAILABLECAPACITYWATCHES); | |
| 87 SystemStorageRemoveAllAvailableCapacityWatchesFunction(); | |
| 88 | |
| 89 private: | |
| 90 virtual ~SystemStorageRemoveAllAvailableCapacityWatchesFunction(); | |
| 91 virtual bool RunImpl() OVERRIDE; | |
| 92 }; | |
| 93 | |
| 94 } // namespace extensions | |
| 95 | |
| 96 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_INFO_STORAGE_API_ H_ | |
| OLD | NEW |