Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_ |
| 7 | 7 |
| 8 #include "storage/common/fileapi/file_system_types.h" | 8 #include "storage/common/fileapi/file_system_types.h" |
| 9 | 9 |
| 10 class GURL; | 10 class GURL; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 | 25 |
| 26 // Obtains the external file url formatted as "externalfile:<path>" from file | 26 // Obtains the external file url formatted as "externalfile:<path>" from file |
| 27 // path. Returns empty URL if the file system does not provide the external file | 27 // path. Returns empty URL if the file system does not provide the external file |
| 28 // URL. | 28 // URL. |
| 29 GURL FileSystemURLToExternalFileURL( | 29 GURL FileSystemURLToExternalFileURL( |
| 30 const storage::FileSystemURL& file_system_url); | 30 const storage::FileSystemURL& file_system_url); |
| 31 | 31 |
| 32 // Converts a externalfile: URL back to a virtual path of FileSystemURL. | 32 // Converts a externalfile: URL back to a virtual path of FileSystemURL. |
| 33 base::FilePath ExternalFileURLToVirtualPath(const GURL& url); | 33 base::FilePath ExternalFileURLToVirtualPath(const GURL& url); |
| 34 | 34 |
| 35 // Converts a virtual path of FileSystemURL to an externalfile: URL. | |
| 36 GURL VirtualPathToExternalFileURL(const base::FilePath& virtual_path); | |
|
hidehiko
2016/10/20 05:28:19
unittest, too, if this is used as a utility from o
hashimoto
2016/10/20 08:36:11
Done.
| |
| 37 | |
| 35 // Obtains external file URL (e.g. external:drive/root/sample.txt) from file | 38 // Obtains external file URL (e.g. external:drive/root/sample.txt) from file |
| 36 // path (e.g. /special/drive-xxx/root/sample.txt), if the |path| points an | 39 // path (e.g. /special/drive-xxx/root/sample.txt), if the |path| points an |
| 37 // external location (drive, MTP, or FSP). Otherwise, it returns empty URL. | 40 // external location (drive, MTP, or FSP). Otherwise, it returns empty URL. |
| 38 GURL CreateExternalFileURLFromPath(Profile* profile, | 41 GURL CreateExternalFileURLFromPath(Profile* profile, |
| 39 const base::FilePath& path); | 42 const base::FilePath& path); |
| 40 | 43 |
| 41 } // namespace chromeos | 44 } // namespace chromeos |
| 42 | 45 |
| 43 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_ | 46 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_ |
| OLD | NEW |