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

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

Issue 10821077: Add gallery permissions to Media Galleries Preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests 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_file_system_registry.cc
diff --git a/chrome/browser/media_gallery/media_file_system_registry.cc b/chrome/browser/media_gallery/media_file_system_registry.cc
index d1b8e21edd93b78fa8209d9ab1b23bfd183bb9bd..1a8f62fc9e3126c058b3385541d76acc75c4df8f 100644
--- a/chrome/browser/media_gallery/media_file_system_registry.cc
+++ b/chrome/browser/media_gallery/media_file_system_registry.cc
@@ -148,16 +148,29 @@ void MediaFileSystemRegistry::Observe(
UnregisterForRPHGoneNotifications(rph);
}
+std::string MediaFileSystemRegistry::GetDeviceIdFromPath(
+ const FilePath& path) const {
+ // TODO(vandebo) Do something better here, at least iterate system monitor
+ // attached media devices looking for a match. If not, return the path.
+ return path.AsUTF8Unsafe();
+}
+
/******************
* Private methods
******************/
MediaFileSystemRegistry::MediaFileSystemRegistry() {
- SystemMonitor::Get()->AddDevicesChangedObserver(this);
+ // SystemMonitor may be NULL in unit tests.
+ SystemMonitor* system_monitor = SystemMonitor::Get();
+ if (system_monitor)
+ system_monitor->AddDevicesChangedObserver(this);
}
MediaFileSystemRegistry::~MediaFileSystemRegistry() {
- SystemMonitor::Get()->RemoveDevicesChangedObserver(this);
+ // SystemMonitor may be NULL in unit tests.
+ SystemMonitor* system_monitor = SystemMonitor::Get();
+ if (system_monitor)
+ system_monitor->RemoveDevicesChangedObserver(this);
}
void MediaFileSystemRegistry::RegisterForRPHGoneNotifications(
« no previous file with comments | « chrome/browser/media_gallery/media_file_system_registry.h ('k') | chrome/browser/media_gallery/media_galleries_preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698