OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DRIVE_FILE_SYSTEM_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "chrome/browser/chromeos/drive/file_errors.h" | 12 #include "chrome/browser/chromeos/drive/file_errors.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace fileapi { | 17 namespace storage { |
18 class FileSystemURL; | 18 class FileSystemURL; |
19 } | 19 } |
20 | 20 |
21 namespace drive { | 21 namespace drive { |
22 | 22 |
23 class DriveAppRegistry; | 23 class DriveAppRegistry; |
24 class DriveServiceInterface; | 24 class DriveServiceInterface; |
25 class FileSystemInterface; | 25 class FileSystemInterface; |
26 | 26 |
27 | 27 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 base::FilePath ExtractDrivePath(const base::FilePath& path); | 103 base::FilePath ExtractDrivePath(const base::FilePath& path); |
104 | 104 |
105 // Extracts |profile| from the given paths located under | 105 // Extracts |profile| from the given paths located under |
106 // GetDriveMountPointPath(profile). Returns NULL if it does not correspond to | 106 // GetDriveMountPointPath(profile). Returns NULL if it does not correspond to |
107 // a valid mount point path. Must be called from UI thread. | 107 // a valid mount point path. Must be called from UI thread. |
108 Profile* ExtractProfileFromPath(const base::FilePath& path); | 108 Profile* ExtractProfileFromPath(const base::FilePath& path); |
109 | 109 |
110 // Extracts the Drive path (e.g., "drive/foo.txt") from the filesystem URL. | 110 // Extracts the Drive path (e.g., "drive/foo.txt") from the filesystem URL. |
111 // Returns an empty path if |url| does not point under Drive mount point. | 111 // Returns an empty path if |url| does not point under Drive mount point. |
112 base::FilePath ExtractDrivePathFromFileSystemUrl( | 112 base::FilePath ExtractDrivePathFromFileSystemUrl( |
113 const fileapi::FileSystemURL& url); | 113 const storage::FileSystemURL& url); |
114 | 114 |
115 // Escapes a file name in Drive cache. | 115 // Escapes a file name in Drive cache. |
116 // Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex) | 116 // Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex) |
117 std::string EscapeCacheFileName(const std::string& filename); | 117 std::string EscapeCacheFileName(const std::string& filename); |
118 | 118 |
119 // Unescapes a file path in Drive cache. | 119 // Unescapes a file path in Drive cache. |
120 // This is the inverse of EscapeCacheFileName. | 120 // This is the inverse of EscapeCacheFileName. |
121 std::string UnescapeCacheFileName(const std::string& filename); | 121 std::string UnescapeCacheFileName(const std::string& filename); |
122 | 122 |
123 // Converts the given string to a form suitable as a file name. Specifically, | 123 // Converts the given string to a form suitable as a file name. Specifically, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 DRIVE_CONNECTED, | 204 DRIVE_CONNECTED, |
205 }; | 205 }; |
206 | 206 |
207 // Returns the Drive connection status for the |profile|. | 207 // Returns the Drive connection status for the |profile|. |
208 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); | 208 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); |
209 | 209 |
210 } // namespace util | 210 } // namespace util |
211 } // namespace drive | 211 } // namespace drive |
212 | 212 |
213 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 213 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |