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_DRIVE_FILE_SYSTEM_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_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/platform_file.h" | 11 #include "base/platform_file.h" |
| 12 #include "chrome/browser/chromeos/drive/drive.pb.h" |
12 #include "chrome/browser/chromeos/drive/drive_file_error.h" | 13 #include "chrome/browser/chromeos/drive/drive_file_error.h" |
13 #include "chrome/browser/google_apis/gdata_errorcode.h" | 14 #include "chrome/browser/google_apis/gdata_errorcode.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 | 16 |
16 class Profile; | 17 class Profile; |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class FilePath; | 20 class FilePath; |
20 } | 21 } |
21 | 22 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Returns the path of the directory representing entries other than "My Drive". | 79 // Returns the path of the directory representing entries other than "My Drive". |
79 const base::FilePath& GetDriveOtherDirPath(); | 80 const base::FilePath& GetDriveOtherDirPath(); |
80 | 81 |
81 // Returns the Drive mount point path, which looks like "/special/drive". | 82 // Returns the Drive mount point path, which looks like "/special/drive". |
82 const base::FilePath& GetDriveMountPointPath(); | 83 const base::FilePath& GetDriveMountPointPath(); |
83 | 84 |
84 // Checks if the resource ID is a special one, which is effective only in our | 85 // Checks if the resource ID is a special one, which is effective only in our |
85 // implementation and is not supposed to be sent to the server. | 86 // implementation and is not supposed to be sent to the server. |
86 bool IsSpecialResourceId(const std::string& resource_id); | 87 bool IsSpecialResourceId(const std::string& resource_id); |
87 | 88 |
| 89 // Returns a DriveEntryProto for "/drive/root" directory. |
| 90 DriveEntryProto CreateMyDriveRootEntry(const std::string& root_resource_id); |
| 91 |
| 92 // Returns a DriveEntryProto for "/drive/other" directory. |
| 93 DriveEntryProto CreateOtherDirEntry(); |
| 94 |
88 // Returns the Drive mount path as string. | 95 // Returns the Drive mount path as string. |
89 const std::string& GetDriveMountPointPathAsString(); | 96 const std::string& GetDriveMountPointPathAsString(); |
90 | 97 |
91 // Returns the 'local' root of remote file system as "/special". | 98 // Returns the 'local' root of remote file system as "/special". |
92 const base::FilePath& GetSpecialRemoteRootPath(); | 99 const base::FilePath& GetSpecialRemoteRootPath(); |
93 | 100 |
94 // Returns the gdata file resource url formatted as "drive:<path>" | 101 // Returns the gdata file resource url formatted as "drive:<path>" |
95 GURL FilePathToDriveURL(const base::FilePath& path); | 102 GURL FilePathToDriveURL(const base::FilePath& path); |
96 | 103 |
97 // Converts a drive: URL back to a path that can be passed to DriveFileSystem. | 104 // Converts a drive: URL back to a path that can be passed to DriveFileSystem. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 void operator()(T* object) const { | 209 void operator()(T* object) const { |
203 if (object) | 210 if (object) |
204 object->Destroy(); | 211 object->Destroy(); |
205 } | 212 } |
206 }; | 213 }; |
207 | 214 |
208 } // namespace util | 215 } // namespace util |
209 } // namespace drive | 216 } // namespace drive |
210 | 217 |
211 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ | 218 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |