OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h" | 5 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "storage/browser/fileapi/file_system_url.h" | 10 #include "storage/browser/fileapi/file_system_url.h" |
11 | 11 |
12 namespace arc { | 12 namespace arc { |
13 | 13 |
14 const char kDocumentsProviderMountPointName[] = "arc-documents-provider"; | 14 const char kDocumentsProviderMountPointName[] = "arc-documents-provider"; |
15 const base::FilePath::CharType kDocumentsProviderMountPointPath[] = | 15 const base::FilePath::CharType kDocumentsProviderMountPointPath[] = |
16 "/special/arc-documents-provider"; | 16 "/special/arc-documents-provider"; |
| 17 const char kAndroidDirectoryMimeType[] = "vnd.android.document/directory"; |
17 | 18 |
18 bool ParseDocumentsProviderUrl(const storage::FileSystemURL& url, | 19 bool ParseDocumentsProviderUrl(const storage::FileSystemURL& url, |
19 std::string* authority, | 20 std::string* authority, |
20 std::string* root_document_id, | 21 std::string* root_document_id, |
21 base::FilePath* path) { | 22 base::FilePath* path) { |
22 if (url.type() != storage::kFileSystemTypeArcDocumentsProvider) | 23 if (url.type() != storage::kFileSystemTypeArcDocumentsProvider) |
23 return false; | 24 return false; |
24 base::FilePath url_path_stripped = url.path().StripTrailingSeparators(); | 25 base::FilePath url_path_stripped = url.path().StripTrailingSeparators(); |
25 | 26 |
26 if (!base::FilePath(kDocumentsProviderMountPointPath) | 27 if (!base::FilePath(kDocumentsProviderMountPointPath) |
(...skipping 18 matching lines...) Expand all Loading... |
45 if (url_path_stripped == root_path) { | 46 if (url_path_stripped == root_path) { |
46 path->clear(); | 47 path->clear(); |
47 } else { | 48 } else { |
48 bool success = root_path.AppendRelativePath(url_path_stripped, path); | 49 bool success = root_path.AppendRelativePath(url_path_stripped, path); |
49 DCHECK(success); | 50 DCHECK(success); |
50 } | 51 } |
51 return true; | 52 return true; |
52 } | 53 } |
53 | 54 |
54 } // namespace arc | 55 } // namespace arc |
OLD | NEW |