Chromium Code Reviews| Index: chrome/browser/storage_monitor/portable_device_watcher_win.cc |
| diff --git a/chrome/browser/storage_monitor/portable_device_watcher_win.cc b/chrome/browser/storage_monitor/portable_device_watcher_win.cc |
| index 2a2b9da9b0894bd04cad45dc3cf439aa525f60de..f86bb38e2ee1057254f10aa60e0013706411b6cf 100644 |
| --- a/chrome/browser/storage_monitor/portable_device_watcher_win.cc |
| +++ b/chrome/browser/storage_monitor/portable_device_watcher_win.cc |
| @@ -555,7 +555,19 @@ void PortableDeviceWatcherWin::SetNotifications( |
| void PortableDeviceWatcherWin::EjectDevice( |
| const std::string& device_id, |
| base::Callback<void(StorageMonitor::EjectStatus)> callback) { |
| - callback.Run(chrome::StorageMonitor::EJECT_FAILURE); |
| + // MTP devices on windows don't have a detach API needed -- signal |
|
Lei Zhang
2013/08/21 21:37:53
nit: Windows
Greg Billock
2013/08/23 20:17:14
Done.
|
| + // the object as if the device is gone and tell the caller it is OK |
| + // to remove. |
| + string16 device_location; // the device_map_ key |
| + string16 storage_object_id; |
| + if (!GetMTPStorageInfoFromDeviceId(device_id, |
| + &device_location, &storage_object_id)) { |
| + callback.Run(chrome::StorageMonitor::EJECT_NO_SUCH_DEVICE); |
| + return; |
| + } |
| + HandleDeviceDetachEvent(device_location); |
| + |
| + callback.Run(chrome::StorageMonitor::EJECT_OK); |
| } |
| void PortableDeviceWatcherWin::EnumerateAttachedDevices() { |