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

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

Issue 10830165: Retry: [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, 4 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 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) {

Powered by Google App Engine
This is Rietveld 408576698