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

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

Issue 11745008: Media Galleries: Add more tests for media gallery names. (try 2) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 12 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_file_system_registry.cc
===================================================================
--- chrome/browser/media_gallery/media_file_system_registry.cc (revision 174919)
+++ chrome/browser/media_gallery/media_file_system_registry.cc (working copy)
@@ -278,9 +278,7 @@
DCHECK(!fsid.empty());
MediaFileSystemInfo new_entry(
- MakeJSONFileSystemName(gallery_info.display_name,
- pref_id,
- device_id),
+ MakeJSONFileSystemName(gallery_info.display_name, pref_id, device_id),
path,
fsid);
result.push_back(new_entry);
@@ -322,16 +320,20 @@
ReplaceChars(name, separators.c_str(), ASCIIToUTF16("_"), &sanitized_name);
base::DictionaryValue dict_value;
- dict_value.SetStringWithoutPathExpansion("name", sanitized_name);
+ dict_value.SetStringWithoutPathExpansion(
+ MediaFileSystemRegistry::kNameKey, sanitized_name);
// This should have been a StringValue, but it's a bit late to change it.
- dict_value.SetIntegerWithoutPathExpansion("galleryId", pref_id);
+ dict_value.SetIntegerWithoutPathExpansion(
+ MediaFileSystemRegistry::kGalleryIdKey, pref_id);
// |device_id| can be empty, in which case, just omit it.
std::string transient_device_id =
GetTransientIdForRemovableDeviceId(device_id);
- if (!transient_device_id.empty())
- dict_value.SetStringWithoutPathExpansion("deviceId", transient_device_id);
+ if (!transient_device_id.empty()) {
+ dict_value.SetStringWithoutPathExpansion(
+ MediaFileSystemRegistry::kDeviceIdKey, transient_device_id);
+ }
std::string json_string;
base::JSONWriter::Write(&dict_value, &json_string);
@@ -423,6 +425,10 @@
* Public methods
******************/
+const char MediaFileSystemRegistry::kDeviceIdKey[] = "deviceId";
+const char MediaFileSystemRegistry::kGalleryIdKey[] = "galleryId";
+const char MediaFileSystemRegistry::kNameKey[] = "name";
+
void MediaFileSystemRegistry::GetMediaFileSystemsForExtension(
const content::RenderViewHost* rvh,
const extensions::Extension* extension,

Powered by Google App Engine
This is Rietveld 408576698