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( |