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

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

Issue 10827057: Plumb file system name down from MediaFileSystemRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 5 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
diff --git a/chrome/browser/media_gallery/media_file_system_registry.cc b/chrome/browser/media_gallery/media_file_system_registry.cc
index 455b4a180a96f6b9051e59f4604dd18388db04b8..ebeca1a5bb4e959de449d0b218c6d4c1ce1af0a5 100644
--- a/chrome/browser/media_gallery/media_file_system_registry.cc
+++ b/chrome/browser/media_gallery/media_file_system_registry.cc
@@ -13,6 +13,7 @@
#include "base/system_monitor/system_monitor.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_source.h"
@@ -56,13 +57,13 @@ MediaFileSystemRegistry* MediaFileSystemRegistry::GetInstance() {
return g_media_file_system_registry.Pointer();
}
-std::vector<MediaFileSystemRegistry::MediaFSIDAndPath>
-MediaFileSystemRegistry::GetMediaFileSystems(
+std::vector<MediaFileSystemRegistry::MediaFSInfo>
+MediaFileSystemRegistry::GetMediaFileSystemsForExtension(
const content::RenderProcessHost* rph,
const extensions::Extension& extension) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- std::vector<MediaFSIDAndPath> results;
+ std::vector<MediaFSInfo> results;
std::pair<ChildIdToMediaFSMap::iterator, bool> ret =
media_fs_map_.insert(std::make_pair(rph, MediaPathToFSIDMap()));
ChildIdToMediaFSMap::iterator& child_it = ret.first;
@@ -99,9 +100,12 @@ MediaFileSystemRegistry::GetMediaFileSystems(
for (MediaPathToFSIDMap::const_iterator it = child_map.begin();
it != child_map.end();
++it) {
- const FilePath path = it->first;
- const std::string fsid = it->second;
- results.push_back(std::make_pair(fsid, path));
+ MediaFSInfo entry;
+ // TODO(vandebo) use a better name, fsid for now.
+ entry.name = it->second;
+ entry.fsid = it->second;
+ entry.path = it->first;
+ results.push_back(entry);
}
return results;
}
@@ -170,7 +174,7 @@ std::string MediaFileSystemRegistry::RegisterPathAsFileSystem(
// The directory name is not exposed to the js layer and we simply use
// a fixed name (as we only register a single directory per file system).
- std::string register_name("_");
+ std::string register_name(extension_misc::kMediaFileSystemPathPart);
const std::string fsid =
IsolatedContext::GetInstance()->RegisterFileSystemForPath(
fileapi::kFileSystemTypeIsolated, path, &register_name);
« no previous file with comments | « chrome/browser/media_gallery/media_file_system_registry.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698