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

Unified Diff: chrome/browser/extensions/api/system_info_storage/storage_info_provider.h

Issue 10876041: Polish the SystemInfoProvider template code and refactor StorageInfoProvider based on it (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use string16 instead of wstring to avoid Presubmit warning Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
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 18f0e6f7da007c331caebf92c55481464f05d9c1..0265ddd0d04031b56caa45818272d3301c66fe62 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
@@ -4,14 +4,15 @@
#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_STORAGE_STORAGE_INFO_PROVIDER_H_
#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_STORAGE_STORAGE_INFO_PROVIDER_H_
+#include "chrome/browser/extensions/system_info_provider.h"
#include "chrome/common/extensions/api/experimental_system_info_storage.h"
namespace extensions {
namespace systeminfo {
-// TODO(hmin): Here the storage type is declared as string type due to the IDL
-// doesn't support enum type yet. Once http://crbug.com/141940 is fixed, we
-// could reuse enum values generated by IDL compiler.
+// TODO(hongbo): Here the storage type is declared as string type due to the
+// IDL doesn't support enum type yet. Once http://crbug.com/141940 is fixed,
+// we could reuse enum values generated by IDL compiler.
// Unknown storage type.
extern const char kStorageTypeUnknown[];
@@ -19,21 +20,22 @@ extern const char kStorageTypeUnknown[];
extern const char kStorageTypeHardDisk[];
// Removable storage, e.g. USB device, flash card reader.
extern const char kStorageTypeRemovable[];
+
} // namespace systeminfo
-// An interface for retrieving storage information on different platforms.
-class StorageInfoProvider {
+class StorageInfoProvider
+ : public SystemInfoProvider<
+ api::experimental_system_info_storage::StorageInfo> {
public:
- // Return a StorageInfoProvider instance. The caller is responsible for
- // destroying it.
- static StorageInfoProvider* Create();
+ virtual ~StorageInfoProvider() {}
- virtual ~StorageInfoProvider() {}
+ // Get the single shared instance of StorageInfoProvider.
+ static StorageInfoProvider* Get();
- // Return true if succeed to get storage information. Should be implemented
- // on different platforms.
- virtual bool GetStorageInfo(
- api::experimental_system_info_storage::StorageInfo* info) = 0;
+ // Get the information for the storage unit specified by the |id| parameter,
+ // and output the result to the |info|.
+ virtual bool QueryUnitInfo(const std::string& id,
+ api::experimental_system_info_storage::StorageUnitInfo* info) = 0;
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698