Chromium Code Reviews| 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(); |