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" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 FileSystemInterface* GetFileSystemByProfileId(void* profile_id); | 78 FileSystemInterface* GetFileSystemByProfileId(void* profile_id); |
79 | 79 |
80 // Returns the DriveAppRegistry for the |profile|. If not available (not | 80 // Returns the DriveAppRegistry for the |profile|. If not available (not |
81 // mounted or disabled), returns NULL. | 81 // mounted or disabled), returns NULL. |
82 DriveAppRegistry* GetDriveAppRegistryByProfile(Profile* profile); | 82 DriveAppRegistry* GetDriveAppRegistryByProfile(Profile* profile); |
83 | 83 |
84 // Returns the DriveService for the |profile|. If not available (not mounted | 84 // Returns the DriveService for the |profile|. If not available (not mounted |
85 // or disabled), returns NULL. | 85 // or disabled), returns NULL. |
86 DriveServiceInterface* GetDriveServiceByProfile(Profile* profile); | 86 DriveServiceInterface* GetDriveServiceByProfile(Profile* profile); |
87 | 87 |
88 // Returns the gdata file resource url formatted as "drive:<path>" | |
89 GURL FilePathToDriveURL(const base::FilePath& path); | |
90 | |
91 // Converts a drive: URL back to a path that can be passed to FileSystem. | |
92 base::FilePath DriveURLToFilePath(const GURL& url); | |
93 | |
94 // Overwrites |url| with a Drive URL when appropriate. | |
95 void MaybeSetDriveURL(Profile* profile, const base::FilePath& path, GURL* url); | |
96 | |
97 // Returns true if the given path is under the Drive mount point. | 88 // Returns true if the given path is under the Drive mount point. |
98 bool IsUnderDriveMountPoint(const base::FilePath& path); | 89 bool IsUnderDriveMountPoint(const base::FilePath& path); |
99 | 90 |
100 // Extracts the Drive path from the given path located under the Drive mount | 91 // Extracts the Drive path from the given path located under the Drive mount |
101 // point. Returns an empty path if |path| is not under the Drive mount point. | 92 // point. Returns an empty path if |path| is not under the Drive mount point. |
102 // Examples: ExtractDrivePath("/special/drive-xxx/foo.txt") => "drive/foo.txt" | 93 // Examples: ExtractDrivePath("/special/drive-xxx/foo.txt") => "drive/foo.txt" |
103 base::FilePath ExtractDrivePath(const base::FilePath& path); | 94 base::FilePath ExtractDrivePath(const base::FilePath& path); |
104 | 95 |
105 // Extracts |profile| from the given paths located under | 96 // Extracts |profile| from the given paths located under |
106 // GetDriveMountPointPath(profile). Returns NULL if it does not correspond to | 97 // GetDriveMountPointPath(profile). Returns NULL if it does not correspond to |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 DRIVE_CONNECTED, | 195 DRIVE_CONNECTED, |
205 }; | 196 }; |
206 | 197 |
207 // Returns the Drive connection status for the |profile|. | 198 // Returns the Drive connection status for the |profile|. |
208 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); | 199 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); |
209 | 200 |
210 } // namespace util | 201 } // namespace util |
211 } // namespace drive | 202 } // namespace drive |
212 | 203 |
213 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 204 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |