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 // Utilities for ARC documents provider file system. | 5 // Utilities for ARC documents provider file system. |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_UTIL_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_UTIL_H_ |
8 #define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_UTIL_H_ | 8 #define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_UTIL_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 | 13 |
| 14 class GURL; |
| 15 |
14 namespace storage { | 16 namespace storage { |
15 class FileSystemURL; | 17 class FileSystemURL; |
16 } // namespace storage | 18 } // namespace storage |
17 | 19 |
18 namespace arc { | 20 namespace arc { |
19 | 21 |
20 // The name of ARC documents provider file system mount point. | 22 // The name of ARC documents provider file system mount point. |
21 extern const char kDocumentsProviderMountPointName[]; | 23 extern const char kDocumentsProviderMountPointName[]; |
22 | 24 |
23 // The path of ARC documents provider file system mount point. | 25 // The path of ARC documents provider file system mount point. |
24 extern const base::FilePath::CharType kDocumentsProviderMountPointPath[]; | 26 extern const base::FilePath::CharType kDocumentsProviderMountPointPath[]; |
25 | 27 |
26 // MIME type for directories in Android. | 28 // MIME type for directories in Android. |
27 // Defined as DocumentsContract.Document.MIME_TYPE_DIR in Android. | 29 // Defined as DocumentsContract.Document.MIME_TYPE_DIR in Android. |
28 extern const char kAndroidDirectoryMimeType[]; | 30 extern const char kAndroidDirectoryMimeType[]; |
29 | 31 |
30 // Parses a FileSystemURL pointing to ARC documents provider file system. | 32 // Parses a FileSystemURL pointing to ARC documents provider file system. |
31 // On success, true is returned. All arguments must not be nullptr. | 33 // On success, true is returned. All arguments must not be nullptr. |
32 bool ParseDocumentsProviderUrl(const storage::FileSystemURL& url, | 34 bool ParseDocumentsProviderUrl(const storage::FileSystemURL& url, |
33 std::string* authority, | 35 std::string* authority, |
34 std::string* root_document_id, | 36 std::string* root_document_id, |
35 base::FilePath* path); | 37 base::FilePath* path); |
36 | 38 |
| 39 // C++ implementation of DocumentsContract.buildDocumentUri() in Android. |
| 40 GURL BuildDocumentUrl(const std::string& authority, |
| 41 const std::string& document_id); |
| 42 |
37 } // namespace arc | 43 } // namespace arc |
38 | 44 |
39 #endif // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_UTIL_H_ | 45 #endif // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_DOCUMENTS_PROVIDER_UTIL_H_ |
OLD | NEW |