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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class DriveAppRegistry; | 23 class DriveAppRegistry; |
24 class DriveServiceInterface; | 24 class DriveServiceInterface; |
25 class FileSystemInterface; | 25 class FileSystemInterface; |
26 | 26 |
27 namespace util { | 27 namespace util { |
28 | 28 |
29 // Returns the Drive mount point path, which looks like "/special/drive-<hash>". | 29 // Returns the Drive mount point path, which looks like "/special/drive-<hash>". |
30 base::FilePath GetDriveMountPointPath(Profile* profile); | 30 base::FilePath GetDriveMountPointPath(Profile* profile); |
31 | 31 |
| 32 // Returns the Drive mount point path, which looks like |
| 33 // "/special/drive-<username_hash>", when provided with the |user_id_hash|. |
| 34 base::FilePath GetDriveMountPointPathForUserIdHash(std::string user_id_hash); |
| 35 |
| 36 // Returns true if the given path is under the Drive mount point. |
| 37 bool IsUnderDriveMountPoint(const base::FilePath& path); |
| 38 |
| 39 // Extracts the Drive path from the given path located under the Drive mount |
| 40 // point. Returns an empty path if |path| is not under the Drive mount point. |
| 41 // Examples: ExtractDrivePath("/special/drive-xxx/foo.txt") => "drive/foo.txt" |
| 42 base::FilePath ExtractDrivePath(const base::FilePath& path); |
| 43 |
32 // Returns the FileSystem for the |profile|. If not available (not mounted | 44 // Returns the FileSystem for the |profile|. If not available (not mounted |
33 // or disabled), returns NULL. | 45 // or disabled), returns NULL. |
34 FileSystemInterface* GetFileSystemByProfile(Profile* profile); | 46 FileSystemInterface* GetFileSystemByProfile(Profile* profile); |
35 | 47 |
36 // Returns a FileSystemInterface instance for the |profile_id|, or NULL | 48 // Returns a FileSystemInterface instance for the |profile_id|, or NULL |
37 // if the Profile for |profile_id| is destructed or Drive File System is | 49 // if the Profile for |profile_id| is destructed or Drive File System is |
38 // disabled for the profile. | 50 // disabled for the profile. |
39 // Note: |profile_id| should be the pointer of the Profile instance if it is | 51 // Note: |profile_id| should be the pointer of the Profile instance if it is |
40 // alive. Considering timing issues due to task posting across threads, | 52 // alive. Considering timing issues due to task posting across threads, |
41 // this function can accept a dangling pointer as |profile_id| (and will return | 53 // this function can accept a dangling pointer as |profile_id| (and will return |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 DRIVE_CONNECTED, | 123 DRIVE_CONNECTED, |
112 }; | 124 }; |
113 | 125 |
114 // Returns the Drive connection status for the |profile|. | 126 // Returns the Drive connection status for the |profile|. |
115 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); | 127 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); |
116 | 128 |
117 } // namespace util | 129 } // namespace util |
118 } // namespace drive | 130 } // namespace drive |
119 | 131 |
120 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 132 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |