Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: chrome/browser/extensions/api/system_storage/storage_info_provider.h

Issue 22548009: [SystemInfo API] Implement storage.getAvailableCapacity API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@impl_get_available_capacity_api2
Patch Set: Rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/system_storage/storage_info_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/system_storage/storage_info_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698