| Index: chrome/browser/extensions/api/system_info_storage/storage_info_provider.h
|
| diff --git a/chrome/browser/extensions/api/system_info_storage/storage_info_provider.h b/chrome/browser/extensions/api/system_info_storage/storage_info_provider.h
|
| index cfa73970961acd7a87c1fdcefed95ce7a872b560..ab2903c9c014cde73d366599c6f03fd5c9100d50 100644
|
| --- a/chrome/browser/extensions/api/system_info_storage/storage_info_provider.h
|
| +++ b/chrome/browser/extensions/api/system_info_storage/storage_info_provider.h
|
| @@ -33,9 +33,10 @@ void BuildStorageUnitInfo(const chrome::StorageInfo& info,
|
| } // namespace systeminfo
|
|
|
| typedef std::vector<linked_ptr<
|
| - api::experimental_system_info_storage::StorageUnitInfo> > StorageInfo;
|
| + api::experimental_system_info_storage::StorageUnitInfo> >
|
| + StorageUnitInfoList;
|
|
|
| -class StorageInfoProvider : public SystemInfoProvider<StorageInfo> {
|
| +class StorageInfoProvider : public SystemInfoProvider<StorageUnitInfoList> {
|
| public:
|
| StorageInfoProvider();
|
|
|
| @@ -47,8 +48,12 @@ class StorageInfoProvider : public SystemInfoProvider<StorageInfo> {
|
| void RemoveObserver(StorageFreeSpaceObserver* obs);
|
|
|
| // Start and stop watching the given storage |transient_id|.
|
| - virtual void StartWatching(const std::string& transient_id);
|
| - virtual void StopWatching(const std::string& transient_id);
|
| + void StartWatching(const std::string& transient_id);
|
| + void StopWatching(const std::string& transient_id);
|
| +
|
| + // Start and stop watching all available storages.
|
| + void StartWatchingAllStorages();
|
| + void StopWatchingAllStorages();
|
|
|
| // Returns all available storages, including fixed and removable.
|
| virtual std::vector<chrome::StorageInfo> GetAllStorages() const;
|
| @@ -62,22 +67,27 @@ class StorageInfoProvider : public SystemInfoProvider<StorageInfo> {
|
| virtual std::string GetDeviceIdForTransientId(
|
| const std::string& transient_id) const;
|
|
|
| + const StorageUnitInfoList& storage_unit_info_list() const;
|
| +
|
| protected:
|
| virtual ~StorageInfoProvider();
|
|
|
| // TODO(Haojian): Put this method in a testing subclass rather than here.
|
| void SetWatchingIntervalForTesting(size_t ms) { watching_interval_ = ms; }
|
|
|
| + // Put all available storages' information into |info_|.
|
| + virtual void GetAllStoragesIntoInfoList();
|
| +
|
| // SystemInfoProvider implementations.
|
| - virtual bool QueryInfo(StorageInfo* info) OVERRIDE;
|
| virtual void StartQueryInfoImpl() OVERRIDE;
|
|
|
| private:
|
| typedef std::map<std::string, double> StorageTransientIdToSizeMap;
|
|
|
| - // Query the available capacity of all known storage devices on the blocking
|
| - // pool, including fixed and removable.
|
| - void QueryAvailableCapacityOnBlockingPool();
|
| + // SystemInfoProvider implementaions.
|
| + // Override to query the available capacity of all known storage devices on
|
| + // the blocking pool, including fixed and removable devices.
|
| + virtual bool QueryInfo() OVERRIDE;
|
| // Query the new attached removable storage info on the blocking pool.
|
| void QueryAttachedStorageInfoOnBlockingPool(const std::string& transient_id);
|
| // Run the QueryInfo() implementation after the StorageMonitor has been
|
|
|