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

Unified Diff: chrome/browser/system_monitor/portable_device_watcher_win.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: Make singleton pointer live in base class. 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/portable_device_watcher_win.cc
diff --git a/chrome/browser/system_monitor/portable_device_watcher_win.cc b/chrome/browser/system_monitor/portable_device_watcher_win.cc
index bd326adf79082383620880e8088a759349fe8ef4..fb2d4f3144d6c08120d388d8afcccea28b0ce2df 100644
--- a/chrome/browser/system_monitor/portable_device_watcher_win.cc
+++ b/chrome/browser/system_monitor/portable_device_watcher_win.cc
@@ -565,8 +565,9 @@ void PortableDeviceWatcherWin::OnDidHandleDeviceAttachEvent(
const string16& name = device_details->name;
const string16& location = device_details->location;
DCHECK(!ContainsKey(device_map_, location));
- base::SystemMonitor* system_monitor = base::SystemMonitor::Get();
- DCHECK(system_monitor);
+ RemovableStorageNotifications* notifications =
+ RemovableStorageNotifications::GetInstance();
+ DCHECK(notifications);
for (StorageObjects::const_iterator storage_iter = storage_objects.begin();
storage_iter != storage_objects.end(); ++storage_iter) {
const std::string& storage_id = storage_iter->object_persistent_id;
@@ -582,10 +583,9 @@ void PortableDeviceWatcherWin::OnDidHandleDeviceAttachEvent(
// partition identifier to the storage name. E.g.: "Nexus 7 (s10001)"
string16 storage_name(name + L" (" + storage_iter->object_temporary_id +
L')');
- storage_map_[storage_id] =
- base::SystemMonitor::RemovableStorageInfo(storage_id, storage_name,
- location);
- system_monitor->ProcessRemovableStorageAttached(
+ storage_map_[storage_id] = RemovableStorageNotifications::StorageInfo(
+ storage_id, storage_name, location);
+ notifications->ProcessAttach(
storage_id, storage_name, GetStoragePathFromStorageId(storage_id));
}
device_map_[location] = storage_objects;
@@ -598,8 +598,9 @@ void PortableDeviceWatcherWin::HandleDeviceDetachEvent(
if (device_iter == device_map_.end())
return;
- base::SystemMonitor* system_monitor = base::SystemMonitor::Get();
- DCHECK(system_monitor);
+ RemovableStorageNotifications* notifications =
+ RemovableStorageNotifications::GetInstance();
+ DCHECK(notifications);
const StorageObjects& storage_objects = device_iter->second;
for (StorageObjects::const_iterator storage_object_iter =
@@ -608,8 +609,7 @@ void PortableDeviceWatcherWin::HandleDeviceDetachEvent(
std::string storage_id = storage_object_iter->object_persistent_id;
MTPStorageMap::iterator storage_map_iter = storage_map_.find(storage_id);
DCHECK(storage_map_iter != storage_map_.end());
- system_monitor->ProcessRemovableStorageDetached(
- storage_map_iter->second.device_id);
+ notifications->ProcessDetach(storage_map_iter->second.device_id);
storage_map_.erase(storage_map_iter);
}
device_map_.erase(device_iter);

Powered by Google App Engine
This is Rietveld 408576698