| 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 CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_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" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 api::system_storage::StorageUnitInfo* unit); | 28 api::system_storage::StorageUnitInfo* unit); |
| 29 | 29 |
| 30 } // namespace systeminfo | 30 } // namespace systeminfo |
| 31 | 31 |
| 32 typedef std::vector<linked_ptr< | 32 typedef std::vector<linked_ptr< |
| 33 api::system_storage::StorageUnitInfo> > | 33 api::system_storage::StorageUnitInfo> > |
| 34 StorageUnitInfoList; | 34 StorageUnitInfoList; |
| 35 | 35 |
| 36 class StorageInfoProvider : public SystemInfoProvider { | 36 class StorageInfoProvider : public SystemInfoProvider { |
| 37 public: | 37 public: |
| 38 typedef base::Callback<void(const std::string&, double)> |
| 39 GetStorageFreeSpaceCallback; |
| 40 |
| 38 // Get the single shared instance of StorageInfoProvider. | 41 // Get the single shared instance of StorageInfoProvider. |
| 39 static StorageInfoProvider* Get(); | 42 static StorageInfoProvider* Get(); |
| 40 | 43 |
| 41 // SystemInfoProvider implementations | 44 // SystemInfoProvider implementations |
| 42 virtual void PrepareQueryOnUIThread() OVERRIDE; | 45 virtual void PrepareQueryOnUIThread() OVERRIDE; |
| 43 virtual void InitializeProvider(const base::Closure& do_query_info_callback) | 46 virtual void InitializeProvider(const base::Closure& do_query_info_callback) |
| 44 OVERRIDE; | 47 OVERRIDE; |
| 45 | 48 |
| 49 virtual double GetStorageFreeSpaceFromTransientIdOnFileThread( |
| 50 const std::string& transient_id); |
| 51 |
| 46 const StorageUnitInfoList& storage_unit_info_list() const; | 52 const StorageUnitInfoList& storage_unit_info_list() const; |
| 47 | 53 |
| 48 static void InitializeForTesting(scoped_refptr<StorageInfoProvider> provider); | 54 static void InitializeForTesting(scoped_refptr<StorageInfoProvider> provider); |
| 49 | 55 |
| 50 protected: | 56 protected: |
| 51 StorageInfoProvider(); | 57 StorageInfoProvider(); |
| 52 | 58 |
| 53 virtual ~StorageInfoProvider(); | 59 virtual ~StorageInfoProvider(); |
| 54 | 60 |
| 55 // Put all available storages' information into |info_|. | 61 // Put all available storages' information into |info_|. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 71 virtual bool QueryInfo() OVERRIDE; | 77 virtual bool QueryInfo() OVERRIDE; |
| 72 | 78 |
| 73 static base::LazyInstance<scoped_refptr<StorageInfoProvider> > provider_; | 79 static base::LazyInstance<scoped_refptr<StorageInfoProvider> > provider_; |
| 74 | 80 |
| 75 DISALLOW_COPY_AND_ASSIGN(StorageInfoProvider); | 81 DISALLOW_COPY_AND_ASSIGN(StorageInfoProvider); |
| 76 }; | 82 }; |
| 77 | 83 |
| 78 } // namespace extensions | 84 } // namespace extensions |
| 79 | 85 |
| 80 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ | 86 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ |
| OLD | NEW |