summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/file_manager_util.cc
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-25 06:19:02 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-25 06:19:02 +0000
commit3976e5dfe1b2c23bb8e573f34d1da1a05403e41f (patch)
tree858230a49fceabe22c886a1a70c3a771f3708560 /chrome/browser/extensions/file_manager_util.cc
parent434da4e43076f7cdb7faf899c2841b6829c01541 (diff)
downloadchromium_src-3976e5dfe1b2c23bb8e573f34d1da1a05403e41f.zip
chromium_src-3976e5dfe1b2c23bb8e573f34d1da1a05403e41f.tar.gz
chromium_src-3976e5dfe1b2c23bb8e573f34d1da1a05403e41f.tar.bz2
Revert 93838 - Merged already reviewed CLs for r/o zip support in ChromeOS file browser:
Re-landing http://codereview.chromium.org/7457001: Adding support for mount point different from removable devices to MountLibrary (work in progress..have to add GetMountPoints support) tested on ChromeOS with these three patches: http://gerrit.chromium.org/gerrit/#change,4447 http://gerrit.chromium.org/gerrit/#change,4449 http://gerrit.chromium.org/gerrit/#change,4544 http://codereview.chromium.org/7471039/: UI for mounting/unmounting archive files. BUG=chromium-os:17673, chromium-os:17783 TEST=Made sure mounting devices still works and that MountCompleted event gets through to file_browser_event_router (checking ui and chrome logs for mount completed entries) TBR=tbarzic, dgozman Review URL: http://codereview.chromium.org/7488044 TBR=zelidrag@chromium.org Review URL: http://codereview.chromium.org/7495024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/file_manager_util.cc')
-rw-r--r--chrome/browser/extensions/file_manager_util.cc27
1 files changed, 5 insertions, 22 deletions
diff --git a/chrome/browser/extensions/file_manager_util.cc b/chrome/browser/extensions/file_manager_util.cc
index 76b5c43..fb19e6c 100644
--- a/chrome/browser/extensions/file_manager_util.cc
+++ b/chrome/browser/extensions/file_manager_util.cc
@@ -27,7 +27,6 @@
// This is the "well known" url for the file manager extension from
// browser/resources/file_manager. In the future we may provide a way to swap
// out this file manager for an aftermarket part, but not yet.
-const char kFileBrowserExtensionUrl[] = FILEBROWSER_URL("");
const char kBaseFileBrowserUrl[] = FILEBROWSER_URL("main.html");
const char kMediaPlayerUrl[] = FILEBROWSER_URL("mediaplayer.html");
const char kMediaPlayerPlaylistUrl[] = FILEBROWSER_URL("playlist.html");
@@ -68,11 +67,6 @@ bool IsSupportedAVExtension(const char* ext) {
}
// static
-GURL FileManagerUtil::GetFileBrowserExtensionUrl() {
- return GURL(kFileBrowserExtensionUrl);
-}
-
-// static
GURL FileManagerUtil::GetFileBrowserUrl() {
return GURL(kBaseFileBrowserUrl);
}
@@ -91,21 +85,6 @@ GURL FileManagerUtil::GetMediaPlayerPlaylistUrl() {
bool FileManagerUtil::ConvertFileToFileSystemUrl(
Profile* profile, const FilePath& full_file_path, const GURL& origin_url,
GURL* url) {
- FilePath virtual_path;
- if (!ConvertFileToRelativeFileSystemPath(profile, full_file_path,
- &virtual_path)) {
- return false;
- }
-
- GURL base_url = fileapi::GetFileSystemRootURI(origin_url,
- fileapi::kFileSystemTypeExternal);
- *url = GURL(base_url.spec() + virtual_path.value());
- return true;
-}
-
-// static
-bool FileManagerUtil::ConvertFileToRelativeFileSystemPath(
- Profile* profile, const FilePath& full_file_path, FilePath* virtual_path) {
fileapi::FileSystemPathManager* path_manager =
profile->GetFileSystemContext()->path_manager();
fileapi::ExternalFileSystemMountPointProvider* provider =
@@ -114,9 +93,13 @@ bool FileManagerUtil::ConvertFileToRelativeFileSystemPath(
return false;
// Find if this file path is managed by the external provider.
- if (!provider->GetVirtualPath(full_file_path, virtual_path))
+ FilePath virtual_path;
+ if (!provider->GetVirtualPath(full_file_path, &virtual_path))
return false;
+ GURL base_url = fileapi::GetFileSystemRootURI(origin_url,
+ fileapi::kFileSystemTypeExternal);
+ *url = GURL(base_url.spec() + virtual_path.value());
return true;
}