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

Unified Diff: chrome/browser/system_monitor/removable_device_notifications_chromeos.h

Issue 10918259: [Chrome OS]Implement MediaStorageUtil::GetDeviceInfoForPath function to support media gallery permi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 3 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/system_monitor/removable_device_notifications_chromeos.h
diff --git a/chrome/browser/system_monitor/removable_device_notifications_chromeos.h b/chrome/browser/system_monitor/removable_device_notifications_chromeos.h
index cae24604fbe21324fcc1740f9f51a85229d17ef2..00a2d6a636464763fd73948584c087f21550391b 100644
--- a/chrome/browser/system_monitor/removable_device_notifications_chromeos.h
+++ b/chrome/browser/system_monitor/removable_device_notifications_chromeos.h
@@ -28,8 +28,11 @@ class RemovableDeviceNotificationsCros
: public base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>,
public disks::DiskMountManager::Observer {
public:
+ // Should only be called by browser start up code. Use GetInstance() instead.
RemovableDeviceNotificationsCros();
+ static RemovableDeviceNotificationsCros* GetInstance();
+
virtual void DiskChanged(disks::DiskMountManagerEventType event,
const disks::DiskMountManager::Disk* disk) OVERRIDE;
virtual void DeviceChanged(disks::DiskMountManagerEventType event,
@@ -39,11 +42,30 @@ class RemovableDeviceNotificationsCros
MountError error_code,
const disks::DiskMountManager::MountPointInfo& mount_info) OVERRIDE;
+ // Finds the device that contains |path| and populates |device_info|.
+ // Returns false if unable to find the device.
+ bool GetDeviceInfoForPath(
+ const FilePath& path,
+ base::SystemMonitor::RemovableStorageInfo* device_info) const;
+
private:
friend class base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>;
- // Mapping of mount points to mount device IDs.
- typedef std::map<std::string, std::string> MountMap;
+ // Structure to save mounted device information such as device unique id, name
+ // and device path.
+ struct DeviceInfo {
Lei Zhang 2012/09/16 00:17:05 Is this already defined elsewhere?
kmadhusu 2012/09/16 22:35:42 DeviceInfo and StorageInfo structs has the same me
+ DeviceInfo();
+
+ // Store the unique device identifier (e.g: "dcim:UUID:AAFF:FFAA")
+ std::string id;
+ // Store the device name (e.g: "USB Co.")
+ string16 name;
+ // Store the device mount path (e.g: "/media/removable/SD card")
+ std::string location;
+ };
+
+ // Mapping of mount path to device info.
+ typedef std::map<std::string, DeviceInfo> MountMap;
// Private to avoid code deleting the object.
virtual ~RemovableDeviceNotificationsCros();

Powered by Google App Engine
This is Rietveld 408576698