Index: chrome/browser/media_gallery/media_device_notifications_linux.cc |
diff --git a/chrome/browser/media_gallery/media_device_notifications_linux.cc b/chrome/browser/media_gallery/media_device_notifications_linux.cc |
index 5c0155b54ba5cc73be107b678b99c14f5fc05da0..7a03383635c7544070a98878dc2ed2af6c718b5e 100644 |
--- a/chrome/browser/media_gallery/media_device_notifications_linux.cc |
+++ b/chrome/browser/media_gallery/media_device_notifications_linux.cc |
@@ -22,6 +22,7 @@ |
#include "base/system_monitor/system_monitor.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/media_gallery/media_device_notifications_utils.h" |
+#include "chrome/browser/media_gallery/media_storage_util.h" |
namespace { |
@@ -339,9 +340,9 @@ void MediaDeviceNotificationsLinux::CheckAndAddMediaDevice( |
if (!IsMediaDevice(mount_point)) |
return; |
- std::string device_id; |
+ std::string unique_id; |
string16 device_name; |
- bool result = (*get_device_info_func_)(mount_device, &device_id, |
+ bool result = (*get_device_info_func_)(mount_device, &unique_id, |
&device_name); |
// Keep track of GetDeviceInfo result, to see how often we fail to get device |
@@ -353,22 +354,22 @@ void MediaDeviceNotificationsLinux::CheckAndAddMediaDevice( |
// Keep track of device uuid, to see how often we receive empty values. |
UMA_HISTOGRAM_BOOLEAN("MediaDeviceNotification.device_uuid_available", |
- !device_id.empty()); |
+ !unique_id.empty()); |
UMA_HISTOGRAM_BOOLEAN("MediaDeviceNotification.device_name_available", |
!device_name.empty()); |
- if (device_id.empty() || device_name.empty()) |
+ if (unique_id.empty() || device_name.empty()) |
return; |
MountDeviceAndId mount_device_and_id; |
mount_device_and_id.mount_device = mount_device; |
- mount_device_and_id.device_id = device_id; |
+ mount_device_and_id.device_id = MediaStorageUtil::MakeDeviceId( |
+ MediaStorageUtil::USB_MASS_STORAGE_WITH_DCIM, unique_id); |
kmadhusu
2012/08/17 18:53:35
Can we construct the DeviceId in get_device_info_f
vandebo (ex-Chrome)
2012/08/17 22:55:51
SGTM. Done.
|
mount_info_map_[mount_point] = mount_device_and_id; |
base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); |
- system_monitor->ProcessMediaDeviceAttached(device_id, |
+ system_monitor->ProcessMediaDeviceAttached(mount_device_and_id.device_id, |
device_name, |
- SystemMonitor::TYPE_PATH, |
mount_point); |
} |