Chromium Code Reviews| Index: chrome/browser/system_monitor/media_storage_util.cc |
| diff --git a/chrome/browser/system_monitor/media_storage_util.cc b/chrome/browser/system_monitor/media_storage_util.cc |
| index 4bc50cb62d8ded3ae81578bd60e4c12a05064657..87d574b3f63ef2c5d07b4aef455ed6ae244b04a9 100644 |
| --- a/chrome/browser/system_monitor/media_storage_util.cc |
| +++ b/chrome/browser/system_monitor/media_storage_util.cc |
| @@ -12,7 +12,6 @@ |
| #include "base/file_util.h" |
| #include "base/logging.h" |
| #include "base/metrics/histogram.h" |
| -#include "base/system_monitor/system_monitor.h" |
| #include "base/utf_string_conversions.h" |
| #include "chrome/browser/system_monitor/media_device_notifications_utils.h" |
| #include "chrome/browser/system_monitor/removable_storage_notifications.h" |
| @@ -22,7 +21,6 @@ |
| #include "chrome/browser/system_monitor/media_transfer_protocol_device_observer_linux.h" |
| #endif |
| -using base::SystemMonitor; |
| using content::BrowserThread; |
| const char kRootPath[] = "/"; |
| @@ -63,11 +61,12 @@ void ValidatePathOnFileThread( |
| } |
| bool IsRemovableStorageAttached(const std::string& id) { |
| - std::vector<SystemMonitor::RemovableStorageInfo> media_devices = |
| - SystemMonitor::Get()->GetAttachedRemovableStorage(); |
| - for (std::vector<SystemMonitor::RemovableStorageInfo>::const_iterator it = |
| - media_devices.begin(); |
| - it != media_devices.end(); |
| + typedef std::vector<RemovableStorageNotifications::StorageInfo> |
| + StorageInfoList; |
| + StorageInfoList devices = |
| + RemovableStorageNotifications::GetInstance()->GetAttachedStorage(); |
| + for (StorageInfoList::const_iterator it = devices.begin(); |
| + it != devices.end(); |
| ++it) { |
| if (it->device_id == id) |
| return true; |
| @@ -77,11 +76,11 @@ bool IsRemovableStorageAttached(const std::string& id) { |
| FilePath::StringType FindRemovableStorageLocationById( |
| const std::string& device_id) { |
| - std::vector<SystemMonitor::RemovableStorageInfo> media_devices = |
| - SystemMonitor::Get()->GetAttachedRemovableStorage(); |
| - for (std::vector<SystemMonitor::RemovableStorageInfo>::const_iterator it = |
| - media_devices.begin(); |
| - it != media_devices.end(); |
| + std::vector<RemovableStorageNotifications::StorageInfo> devices = |
| + RemovableStorageNotifications::GetInstance()->GetAttachedStorage(); |
| + for (std::vector<RemovableStorageNotifications::StorageInfo>:: |
|
vandebo (ex-Chrome)
2013/01/26 01:00:21
One more instance here.
Greg Billock
2013/01/26 01:42:07
Done.
|
| + const_iterator it = devices.begin(); |
| + it != devices.end(); |
| ++it) { |
| if (it->device_id == device_id) |
| return it->location; |
| @@ -242,7 +241,7 @@ void MediaStorageUtil::IsDeviceAttached(const std::string& device_id, |
| DCHECK(type == MTP_OR_PTP || |
| type == REMOVABLE_MASS_STORAGE_WITH_DCIM || |
| type == REMOVABLE_MASS_STORAGE_NO_DCIM); |
| - // We should be able to find removable storage in SystemMonitor. |
| + // We should be able to find removable storage. |
| callback.Run(IsRemovableStorageAttached(device_id)); |
| } |
| } |
| @@ -277,7 +276,7 @@ bool MediaStorageUtil::GetDeviceInfoFromPath(const FilePath& path, |
| } |
| bool found_device = false; |
| - base::SystemMonitor::RemovableStorageInfo device_info; |
| + RemovableStorageNotifications::StorageInfo device_info; |
| #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
| RemovableStorageNotifications* notifier = |
| RemovableStorageNotifications::GetInstance(); |