| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef EXTENSIONS_BROWSER_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ |
| 6 #define EXTENSIONS_BROWSER_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ | 6 #define EXTENSIONS_BROWSER_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/observer_list_threadsafe.h" | 12 #include "base/observer_list_threadsafe.h" |
| 13 #include "extensions/browser/api/system_info/system_info_provider.h" | 13 #include "extensions/browser/api/system_info/system_info_provider.h" |
| 14 #include "extensions/common/api/system_storage.h" | 14 #include "extensions/common/api/system_storage.h" |
| 15 | 15 |
| 16 namespace storage_monitor { | 16 namespace storage_monitor { |
| 17 class StorageInfo; | 17 class StorageInfo; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace extensions { | 20 namespace extensions { |
| 21 | 21 |
| 22 namespace systeminfo { | 22 namespace systeminfo { |
| 23 | 23 |
| 24 // Build StorageUnitInfo struct from StorageInfo instance. The |unit| | 24 // Build StorageUnitInfo struct from StorageInfo instance. The |unit| |
| 25 // parameter is the output value. | 25 // parameter is the output value. |
| 26 void BuildStorageUnitInfo(const storage_monitor::StorageInfo& info, | 26 void BuildStorageUnitInfo(const storage_monitor::StorageInfo& info, |
| 27 core_api::system_storage::StorageUnitInfo* unit); | 27 api::system_storage::StorageUnitInfo* unit); |
| 28 | 28 |
| 29 } // namespace systeminfo | 29 } // namespace systeminfo |
| 30 | 30 |
| 31 typedef std::vector<linked_ptr<core_api::system_storage::StorageUnitInfo> > | 31 typedef std::vector<linked_ptr<api::system_storage::StorageUnitInfo>> |
| 32 StorageUnitInfoList; | 32 StorageUnitInfoList; |
| 33 | 33 |
| 34 class StorageInfoProvider : public SystemInfoProvider { | 34 class StorageInfoProvider : public SystemInfoProvider { |
| 35 public: | 35 public: |
| 36 typedef base::Callback<void(const std::string&, double)> | 36 typedef base::Callback<void(const std::string&, double)> |
| 37 GetStorageFreeSpaceCallback; | 37 GetStorageFreeSpaceCallback; |
| 38 | 38 |
| 39 // Get the single shared instance of StorageInfoProvider. | 39 // Get the single shared instance of StorageInfoProvider. |
| 40 static StorageInfoProvider* Get(); | 40 static StorageInfoProvider* Get(); |
| 41 | 41 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 bool QueryInfo() override; | 74 bool QueryInfo() override; |
| 75 | 75 |
| 76 static base::LazyInstance<scoped_refptr<StorageInfoProvider> > provider_; | 76 static base::LazyInstance<scoped_refptr<StorageInfoProvider> > provider_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(StorageInfoProvider); | 78 DISALLOW_COPY_AND_ASSIGN(StorageInfoProvider); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace extensions | 81 } // namespace extensions |
| 82 | 82 |
| 83 #endif // EXTENSIONS_BROWSER_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ | 83 #endif // EXTENSIONS_BROWSER_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ |
| OLD | NEW |