| 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" |
| 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 "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
| 14 #include "chrome/browser/extensions/api/system_info/system_info_provider.h" | 14 #include "chrome/browser/extensions/api/system_info/system_info_provider.h" |
| 15 #include "chrome/browser/storage_monitor/removable_storage_observer.h" | 15 #include "chrome/browser/storage_monitor/removable_storage_observer.h" |
| 16 #include "chrome/browser/storage_monitor/storage_info.h" | 16 #include "chrome/browser/storage_monitor/storage_info.h" |
| 17 #include "chrome/common/extensions/api/system_storage.h" | 17 #include "chrome/common/extensions/api/system_storage.h" |
| 18 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 20 | 20 |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 | 22 |
| 23 namespace systeminfo { | 23 namespace systeminfo { |
| 24 | 24 |
| 25 // Build StorageUnitInfo struct from chrome::StorageInfo instance. The |unit| | 25 // Build StorageUnitInfo struct from StorageInfo instance. The |unit| |
| 26 // parameter is the output value. | 26 // parameter is the output value. |
| 27 void BuildStorageUnitInfo(const chrome::StorageInfo& info, | 27 void BuildStorageUnitInfo(const StorageInfo& info, |
| 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 // Get the single shared instance of StorageInfoProvider. | 38 // Get the single shared instance of StorageInfoProvider. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 virtual bool QueryInfo() OVERRIDE; | 71 virtual bool QueryInfo() OVERRIDE; |
| 72 | 72 |
| 73 static base::LazyInstance<scoped_refptr<StorageInfoProvider> > provider_; | 73 static base::LazyInstance<scoped_refptr<StorageInfoProvider> > provider_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(StorageInfoProvider); | 75 DISALLOW_COPY_AND_ASSIGN(StorageInfoProvider); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace extensions | 78 } // namespace extensions |
| 79 | 79 |
| 80 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ | 80 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_ |
| OLD | NEW |