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

Unified Diff: chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc

Issue 15294020: StorageMonitor: Make StorageInfo a real class. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address nits Created 7 years, 7 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/storage_monitor/test_volume_mount_watcher_win.cc
===================================================================
--- chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc (revision 201619)
+++ chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc (working copy)
@@ -44,26 +44,24 @@
// Truncate to root path.
base::FilePath path(device_path);
- if (device_path.value().length() > 3) {
+ if (device_path.value().length() > 3)
path = base::FilePath(device_path.value().substr(0, 3));
- }
- if (path.value()[0] < L'A' || path.value()[0] > L'Z') {
+ if (path.value()[0] < L'A' || path.value()[0] > L'Z')
return false;
- }
- info->location = path.value();
- info->total_size_in_bytes = 1000000;
-
- std::string unique_id =
- "\\\\?\\Volume{00000000-0000-0000-0000-000000000000}\\";
- unique_id[11] = device_path.value()[0];
- chrome::StorageInfo::Type type = chrome::StorageInfo::FIXED_MASS_STORAGE;
+ StorageInfo::Type type = StorageInfo::FIXED_MASS_STORAGE;
if (path.value() != ASCIIToUTF16("N:\\") &&
path.value() != ASCIIToUTF16("C:\\")) {
- type = chrome::StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM;
+ type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM;
}
- info->device_id = chrome::StorageInfo::MakeDeviceId(type, unique_id);
- info->storage_label = path.Append(L" Drive").LossyDisplayName();
+ std::string unique_id =
+ "\\\\?\\Volume{00000000-0000-0000-0000-000000000000}\\";
+ unique_id[11] = device_path.value()[0];
+ std::string device_id = StorageInfo::MakeDeviceId(type, unique_id);
+ string16 storage_label = path.Append(L" Drive").LossyDisplayName();
+ *info = StorageInfo(device_id, string16(), path.value(), storage_label,
+ string16(), string16(), 1000000);
+
return true;
}
@@ -82,11 +80,8 @@
const std::string& device_id,
const string16& device_name,
uint64 total_size_in_bytes) {
- StorageInfo info;
- info.device_id = device_id;
- info.location = device_path.value();
- info.name = device_name;
- info.total_size_in_bytes = total_size_in_bytes;
+ StorageInfo info(device_id, device_name, device_path.value(),
+ string16(), string16(), string16(), total_size_in_bytes);
HandleDeviceAttachEventOnUIThread(device_path, info);
}
@@ -120,7 +115,7 @@
bool* removable) const {
StorageInfo info;
bool success = GetMassStorageDeviceDetails(device_path, &info);
- *removable = StorageInfo::IsRemovableDevice(info.device_id);
+ *removable = StorageInfo::IsRemovableDevice(info.device_id());
return success;
}
« no previous file with comments | « chrome/browser/storage_monitor/test_storage_monitor.cc ('k') | chrome/browser/storage_monitor/volume_mount_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698