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

Unified Diff: chrome/browser/extensions/api/image_writer_private/removable_storage_provider_win.cc

Issue 291333006: Adds removable-drive listing for OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removes unnecessary changes. Created 6 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/extensions/api/image_writer_private/removable_storage_provider_win.cc
diff --git a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_win.cc b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_win.cc
index ffac02d3b772fa6eaa24f9b2ad207b51a3498c47..097e434ee106f92a68e0dc6e55bc721d4e052a62 100644
--- a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_win.cc
+++ b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_win.cc
@@ -151,8 +151,10 @@ bool AddDeviceInfo(HANDLE interface_enumerator,
} // namespace
-bool RemovableStorageProvider::PopulateDeviceList(
- scoped_refptr<StorageDeviceList> device_list) {
+void RemovableStorageProvider::GetAllDevicesImpl(
+ DeviceListReadyCallback& callback) {
+ scoped_refptr<StorageDeviceList> device_list(new StorageDeviceList);
+
HDEVINFO interface_enumerator = SetupDiGetClassDevs(
&DiskClassGuid,
NULL, // Enumerator.
@@ -162,7 +164,8 @@ bool RemovableStorageProvider::PopulateDeviceList(
if (interface_enumerator == INVALID_HANDLE_VALUE) {
DPLOG(ERROR) << "SetupDiGetClassDevs failed.";
- return false;
+ callback.Run(device_list, false);
+ return;
}
DWORD index = 0;
@@ -184,11 +187,13 @@ bool RemovableStorageProvider::PopulateDeviceList(
if (error_code != ERROR_NO_MORE_ITEMS) {
PLOG(ERROR) << "SetupDiEnumDeviceInterfaces failed";
SetupDiDestroyDeviceInfoList(interface_enumerator);
- return false;
+ callback.Run(device_list, false);
+ return;
}
SetupDiDestroyDeviceInfoList(interface_enumerator);
- return true;
+
+ callback.Run(device_list, true);
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698