Index: chrome/browser/system_monitor/media_device_notifications_utils.cc |
diff --git a/chrome/browser/system_monitor/media_device_notifications_utils.cc b/chrome/browser/system_monitor/media_device_notifications_utils.cc |
index 5453eb6e8ce4abb1a14804c7c24dc7910bdbedf4..21b0d3977c595855c09c8485b34d81585b372b39 100644 |
--- a/chrome/browser/system_monitor/media_device_notifications_utils.cc |
+++ b/chrome/browser/system_monitor/media_device_notifications_utils.cc |
@@ -5,7 +5,9 @@ |
#include "chrome/browser/system_monitor/media_device_notifications_utils.h" |
#include "base/file_util.h" |
+#include "base/string16.h" |
#include "base/string_util.h" |
+#include "base/utf_string_conversions.h" |
#include "content/public/browser/browser_thread.h" |
namespace { |
@@ -34,4 +36,23 @@ bool IsMediaDevice(const FilePath::StringType& mount_point) { |
return true; |
} |
+std::string GetDeviceManufacturerName(const std::string& vendor_name, |
+ const std::string& model_name) { |
+ if (!vendor_name.empty() && !model_name.empty()) |
Lei Zhang
2012/11/12 07:46:56
Do you think this will be a little better?
if (ve
kmadhusu
2012/11/12 19:56:56
Sure. I tried to avoid the temp variable "product_
|
+ return "(" + vendor_name + ", " + model_name + ")"; |
+ else if (!vendor_name.empty()) |
+ return "(" + vendor_name + ")"; |
+ else if (!model_name.empty()) |
+ return "(" + model_name + ")"; |
+ else |
+ return std::string(); |
+} |
+ |
+string16 GetDisplayNameForDevice(const string16& device_partition_size, |
+ const string16& name) { |
+ DCHECK(!name.empty()); |
+ return device_partition_size.empty() ? |
+ name : device_partition_size + ASCIIToUTF16(" ") + name; |
+} |
+ |
} // namespace chrome |