Chromium Code Reviews| Index: chrome/browser/chromeos/fileapi/file_system_backend.cc |
| diff --git a/chrome/browser/chromeos/fileapi/file_system_backend.cc b/chrome/browser/chromeos/fileapi/file_system_backend.cc |
| index 9992f284d652bc2040afdbfd20f34c188142c04f..0a77c063f164c80349f549eefeeda2a09c889e9d 100644 |
| --- a/chrome/browser/chromeos/fileapi/file_system_backend.cc |
| +++ b/chrome/browser/chromeos/fileapi/file_system_backend.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/command_line.h" |
| #include "base/logging.h" |
| #include "base/memory/ptr_util.h" |
| +#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h" |
| #include "chrome/browser/chromeos/fileapi/file_access_permissions.h" |
| #include "chrome/browser/chromeos/fileapi/file_system_backend_delegate.h" |
| #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
| @@ -156,6 +157,21 @@ void FileSystemBackend::ResolveURL(const storage::FileSystemURL& url, |
| std::string inner_mount_name = components[1]; |
| root_url += inner_mount_name + "/"; |
| name = inner_mount_name; |
| + } else if (id == arc::kDocumentsProviderMountPointName) { |
| + // For ARC documents provider file system, volumes are mounted per document |
| + // provider root, so we need to fix up |root_url| to point to an individual |
| + // root. |
| + std::string authority; |
| + std::string root_document_id; |
| + base::FilePath unused_path; |
| + if (!arc::ParseDocumentsProviderUrl(url, &authority, &root_document_id, |
| + &unused_path)) { |
| + callback.Run(GURL(root_url), std::string(), |
| + base::File::FILE_ERROR_SECURITY); |
| + return; |
| + } |
| + root_url += authority + "/" + root_document_id + "/"; |
|
mtomasz
2017/01/11 09:35:22
Does root_document_id need to be escaped?
Shuhei Takahashi
2017/01/12 08:20:28
You're right. Done.
|
| + name = authority + ":" + root_document_id; |
| } else { |
| name = id; |
| } |