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

Unified Diff: chrome/browser/system_monitor/media_storage_util.cc

Issue 11573048: [Media Galleries] Move RemovableStorageInfo notifications to chrome namespace (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing up tests Created 7 years, 11 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/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..8e027e1bf89dc61483a77764ca2b2cef53220c08 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,11 @@ 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();
+ std::vector<RemovableStorageNotifications::StorageInfo> devices =
+ RemovableStorageNotifications::GetInstance()->GetAttachedStorage();
+ for (std::vector<RemovableStorageNotifications::StorageInfo>::
vandebo (ex-Chrome) 2013/01/24 19:19:10 nit: add a typedef for the vector<StorageInfo> typ
Greg Billock 2013/01/24 20:46:03 Yeah, I thought about this. I don't like typedefs,
vandebo (ex-Chrome) 2013/01/24 23:39:01 I'm not the biggest fan of typedefs, but when it s
Greg Billock 2013/01/25 20:01:21 Done.
+ const_iterator it = devices.begin();
+ it != devices.end();
++it) {
if (it->device_id == id)
return true;
@@ -77,11 +75,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>::
+ const_iterator it = devices.begin();
+ it != devices.end();
++it) {
if (it->device_id == device_id)
return it->location;
@@ -242,7 +240,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 +275,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();

Powered by Google App Engine
This is Rietveld 408576698