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

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

Issue 11366144: [Media Gallery][ChromeOS] Improve device media gallery names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments + Added util functions Created 8 years, 1 month 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/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

Powered by Google App Engine
This is Rietveld 408576698