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

Unified Diff: chrome/browser/extensions/file_manager_util.cc

Issue 7058001: Fixed media file API urls that are handed over to media player. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/file_manager_util.cc
===================================================================
--- chrome/browser/extensions/file_manager_util.cc (revision 86051)
+++ chrome/browser/extensions/file_manager_util.cc (working copy)
@@ -81,11 +81,19 @@
iter != root_dirs.end();
++iter) {
FilePath path;
+ std::vector<FilePath::StringType> components;
const FilePath& root_path = *iter;
+ root_path.GetComponents(&components);
+ if (!components.size()) {
+ NOTREACHED();
+ continue;
+ }
if (root_path.AppendRelativePath(full_file_path, &path)) {
GURL base_url = fileapi::GetFileSystemRootURI(origin_url,
fileapi::kFileSystemTypeExternal);
- *url = GURL(base_url.spec() + root_path.Append(path).value().substr(1));
+ std::string final_url = base_url.spec();
achuithb 2011/05/20 22:01:04 final_url unused.
+ FilePath relative_path(components[components.size() - 1]);
+ *url = GURL(base_url.spec() + relative_path.Append(path).value());
achuithb 2011/05/20 22:01:04 Hmm, I don't understand this. Do you think a comme
return true;
}
}
@@ -154,7 +162,7 @@
return;
}
- // Unknwon file type. Show an error message.
+ // Unknown file type. Show an error message.
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableFunction(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698