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

Unified Diff: chrome/browser/media_gallery/media_device_notifications_chromeos.cc

Issue 10843061: [CrOS] Enumerate existing mount points and check for media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/media_gallery/media_device_notifications_chromeos.cc
diff --git a/chrome/browser/media_gallery/media_device_notifications_chromeos.cc b/chrome/browser/media_gallery/media_device_notifications_chromeos.cc
index f8bb783faee3b50d9487b42f756a8025b1451759..1e6002c04d5c81ba797f0e5d27997726fcbe9c87 100644
--- a/chrome/browser/media_gallery/media_device_notifications_chromeos.cc
+++ b/chrome/browser/media_gallery/media_device_notifications_chromeos.cc
@@ -34,6 +34,7 @@ using content::BrowserThread;
MediaDeviceNotifications::MediaDeviceNotifications() {
DCHECK(disks::DiskMountManager::GetInstance());
disks::DiskMountManager::GetInstance()->AddObserver(this);
+ CheckExistingMountPoints();
}
MediaDeviceNotifications::~MediaDeviceNotifications() {
@@ -43,6 +44,18 @@ MediaDeviceNotifications::~MediaDeviceNotifications() {
}
}
+void MediaDeviceNotifications::CheckExistingMountPoints() {
+ const disks::DiskMountManager::MountPointMap& mount_point_map =
+ disks::DiskMountManager::GetInstance()->mount_points();
+ for (disks::DiskMountManager::MountPointMap::const_iterator it =
+ mount_point_map.begin(); it != mount_point_map.end(); ++it) {
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&MediaDeviceNotifications::CheckMountedPathOnFileThread,
+ this, it->second));
+ }
+}
+
void MediaDeviceNotifications::DiskChanged(
disks::DiskMountManagerEventType event,
const disks::DiskMountManager::Disk* disk) {

Powered by Google App Engine
This is Rietveld 408576698