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

Unified Diff: chrome/browser/system_monitor/volume_mount_watcher_win.h

Issue 12147002: Add a receiver interface to RemovableStorageNotifications. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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/volume_mount_watcher_win.h
diff --git a/chrome/browser/system_monitor/volume_mount_watcher_win.h b/chrome/browser/system_monitor/volume_mount_watcher_win.h
index 86b6974d3c3b7aa21565aa85447bfe5271e1514e..a74948fded967f76bf5dda008df84f718da75163 100644
--- a/chrome/browser/system_monitor/volume_mount_watcher_win.h
+++ b/chrome/browser/system_monitor/volume_mount_watcher_win.h
@@ -20,11 +20,11 @@
namespace chrome {
// This class watches the volume mount points and sends notifications to
-// base::SystemMonitor about the device attach/detach events. This is a
-// singleton class instantiated by RemovableDeviceNotificationsWindowWin.
+// RemovableStorageNotifications about the device attach/detach events.
+// This is a singleton class instantiated by
+// RemovableDeviceNotificationsWindowWin.
class VolumeMountWatcherWin {
public:
- // TODO(gbillock): Take the RemovableStorageNotifications as an argument.
VolumeMountWatcherWin();
virtual ~VolumeMountWatcherWin();
@@ -48,6 +48,10 @@ class VolumeMountWatcherWin {
// notification if appropriate.
void OnWindowMessage(UINT event_type, LPARAM data);
+ // Set the volume notifications object to be used when new
+ // removable volumes are found.
+ void SetNotifications(RemovableStorageNotifications::Receiver* notifications);
+
protected:
struct MountPointInfo {
std::string device_id;
@@ -109,6 +113,10 @@ class VolumeMountWatcherWin {
base::WeakPtrFactory<VolumeMountWatcherWin> weak_factory_;
+ // The notifications object to use to signal newly attached volumes. Only
+ // removable devices will be notified.
+ RemovableStorageNotifications::Receiver* notifications_;
+
DISALLOW_COPY_AND_ASSIGN(VolumeMountWatcherWin);
};

Powered by Google App Engine
This is Rietveld 408576698