Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / chromeos / fileapi / external_file_url_util.h
blobafcf8ca858c6a8e61b2ea37b857748055e537aaf
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_
8 #include "storage/common/fileapi/file_system_types.h"
10 class GURL;
11 class Profile;
13 namespace base {
14 class FilePath;
17 namespace storage {
18 class FileSystemURL;
21 namespace chromeos {
23 // Returns whether the external file URL is provided for the |type| or not.
24 bool IsExternalFileURLType(storage::FileSystemType type);
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
28 // URL.
29 GURL FileSystemURLToExternalFileURL(
30 const storage::FileSystemURL& file_system_url);
32 // Converts a externalfile: URL back to a virtual path of FileSystemURL.
33 base::FilePath ExternalFileURLToVirtualPath(const GURL& url);
35 // 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
37 // external location (drive, MTP, or FSP). Otherwise, it returns empty URL.
38 GURL CreateExternalFileURLFromPath(Profile* profile,
39 const base::FilePath& path);
41 } // namespace chromeos
43 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_UTIL_H_