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

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

Issue 10829384: SystemMonitor: Pull device type into the device id (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_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);
}

Powered by Google App Engine
This is Rietveld 408576698