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

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: Addressed comments. 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
« no previous file with comments | « chrome/browser/media_gallery/media_device_notifications_chromeos.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d2bc137342832de330c57b23151594feb26e4503 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);
+ CheckExistingMountPointsOnUIThread();
}
MediaDeviceNotifications::~MediaDeviceNotifications() {
@@ -43,6 +44,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) {
« no previous file with comments | « chrome/browser/media_gallery/media_device_notifications_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698