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

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: Merging Created 7 years, 10 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 c940add4e5699bbfdc016a926efb917840c8621a..721c034e47d032a668adabe644dea8b4c1c48124 100644
--- a/chrome/browser/system_monitor/volume_mount_watcher_win.h
+++ b/chrome/browser/system_monitor/volume_mount_watcher_win.h
@@ -16,15 +16,16 @@
#include "base/memory/weak_ptr.h"
#include "base/string16.h"
#include "base/threading/sequenced_worker_pool.h"
+#include "chrome/browser/system_monitor/removable_storage_notifications.h"
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 +49,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;
@@ -110,6 +115,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