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

Unified Diff: chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.cc

Issue 11164003: Media Galleries: Initialize the internal state of MediaGalleriesPrivateEventRouter with the list of… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.cc
===================================================================
--- chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.cc (revision 162049)
+++ chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.cc (working copy)
@@ -88,8 +88,17 @@
Profile* profile)
: profile_(profile) {
base::SystemMonitor* system_monitor = base::SystemMonitor::Get();
- if (system_monitor)
+ if (system_monitor) {
system_monitor->AddDevicesChangedObserver(this);
+
+ // Add the devices that were already present before
+ // MediaGalleriesPrivateEventRouter creation.
+ std::vector<base::SystemMonitor::RemovableStorageInfo> storage_info =
+ system_monitor->GetAttachedRemovableStorage();
+ TransientDeviceIds* device_ids = TransientDeviceIds::GetInstance();
+ for (size_t i = 0; i < storage_info.size(); ++i)
+ device_ids->DeviceAttached(storage_info[i].device_id);
+ }
}
MediaGalleriesPrivateEventRouter::~MediaGalleriesPrivateEventRouter() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698