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 b645223c4beedcd38af930a6024d33e3acb5f510..9d29a73d8343abda4e6e965d54c836670c6e9feb 100644 |
--- a/chrome/browser/media_gallery/media_device_notifications_chromeos.cc |
+++ b/chrome/browser/media_gallery/media_device_notifications_chromeos.cc |
@@ -46,6 +46,7 @@ using content::BrowserThread; |
MediaDeviceNotifications::MediaDeviceNotifications() { |
DCHECK(disks::DiskMountManager::GetInstance()); |
disks::DiskMountManager::GetInstance()->AddObserver(this); |
+ CheckExistingMountPointsOnUIThread(); |
} |
MediaDeviceNotifications::~MediaDeviceNotifications() { |
@@ -55,6 +56,19 @@ MediaDeviceNotifications::~MediaDeviceNotifications() { |
} |
} |
+void MediaDeviceNotifications::CheckExistingMountPointsOnUIThread() { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ 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) { |