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

Unified Diff: chrome/browser/system_monitor/removable_device_notifications_linux.cc

Issue 10933114: Combine boolean MediaDeviceNotifications histograms to an enumerated histogram. (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_linux.cc
diff --git a/chrome/browser/system_monitor/removable_device_notifications_linux.cc b/chrome/browser/system_monitor/removable_device_notifications_linux.cc
index e474b36dc396287f109ed05ab41706f4a9630b8f..d740cf74c43a18ae94cbebb082b55f619b66908d 100644
--- a/chrome/browser/system_monitor/removable_device_notifications_linux.cc
+++ b/chrome/browser/system_monitor/removable_device_notifications_linux.cc
@@ -15,7 +15,6 @@
#include "base/bind.h"
#include "base/file_path.h"
#include "base/memory/scoped_generic_obj.h"
-#include "base/metrics/histogram.h"
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
@@ -24,6 +23,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/system_monitor/media_device_notifications_utils.h"
#include "chrome/browser/system_monitor/removable_device_constants.h"
+#include "chrome/browser/system_monitor/removable_device_notifications_histogram.h"
#include "chrome/browser/system_monitor/media_storage_util.h"
namespace chrome {
@@ -470,15 +470,6 @@ void RemovableDeviceNotificationsLinux::AddNewMount(
bool removable;
get_device_info_func_(mount_device, &unique_id, &name, &removable);
-
- // Keep track of device uuid, to see how often we receive empty values.
- UMA_HISTOGRAM_BOOLEAN("MediaDeviceNotification.DeviceUUIDAvailable",
- !unique_id.empty());
- UMA_HISTOGRAM_BOOLEAN("MediaDeviceNotification.DeviceNameAvailable",
- !name.empty());
- if (unique_id.empty() || name.empty())
- return;
-
bool has_dcim = IsMediaDevice(mount_point.value());
MediaStorageUtil::Type type;
if (removable) {
@@ -490,6 +481,12 @@ void RemovableDeviceNotificationsLinux::AddNewMount(
} else {
type = MediaStorageUtil::FIXED_MASS_STORAGE;
}
+
+ // Keep track of device info details to see how often we get invalid values.
+ RecordDeviceInfoHistogram(type, unique_id, name);
+ if (unique_id.empty() || name.empty())
vandebo (ex-Chrome) 2012/09/16 22:27:46 No point in figuring out the precise type if we're
kmadhusu 2012/09/17 18:29:07 Fixed.
+ return;
+
std::string device_id = MediaStorageUtil::MakeDeviceId(type, unique_id);
MountPointInfo mount_point_info;

Powered by Google App Engine
This is Rietveld 408576698