Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 class ResourceEntry; | 29 class ResourceEntry; |
| 30 | 30 |
| 31 namespace util { | 31 namespace util { |
| 32 | 32 |
| 33 // "drive" diretory's local ID is fixed to this value. | 33 // "drive" diretory's local ID is fixed to this value. |
| 34 const char kDriveGrandRootLocalId[] = "<drive>"; | 34 const char kDriveGrandRootLocalId[] = "<drive>"; |
| 35 | 35 |
| 36 // "drive/other" diretory's local ID is fixed to this value. | 36 // "drive/other" diretory's local ID is fixed to this value. |
| 37 const char kDriveOtherDirLocalId[] = "<other>"; | 37 const char kDriveOtherDirLocalId[] = "<other>"; |
| 38 | 38 |
| 39 // "drive/trash" diretory's local ID is fixed to this value. | |
| 40 const char kDriveTrashDirLocalId[] = "<trash>"; | |
| 41 | |
| 39 // The directory names used for the Google Drive file system tree. These names | 42 // The directory names used for the Google Drive file system tree. These names |
| 40 // are used in URLs for the file manager, hence user-visible. | 43 // are used in URLs for the file manager, hence user-visible. |
| 41 const base::FilePath::CharType kDriveGrandRootDirName[] = | 44 const base::FilePath::CharType kDriveGrandRootDirName[] = |
| 42 FILE_PATH_LITERAL("drive"); | 45 FILE_PATH_LITERAL("drive"); |
| 43 | 46 |
| 44 const base::FilePath::CharType kDriveMyDriveRootDirName[] = | 47 const base::FilePath::CharType kDriveMyDriveRootDirName[] = |
| 45 FILE_PATH_LITERAL("root"); | 48 FILE_PATH_LITERAL("root"); |
| 46 | 49 |
| 47 const base::FilePath::CharType kDriveOtherDirName[] = | 50 const base::FilePath::CharType kDriveOtherDirName[] = |
| 48 FILE_PATH_LITERAL("other"); | 51 FILE_PATH_LITERAL("other"); |
| 49 | 52 |
| 53 const base::FilePath::CharType kDriveTrashDirName[] = | |
| 54 FILE_PATH_LITERAL("trash"); | |
| 55 | |
| 50 // Returns the path of the top root of the pseudo tree. | 56 // Returns the path of the top root of the pseudo tree. |
| 51 const base::FilePath& GetDriveGrandRootPath(); | 57 const base::FilePath& GetDriveGrandRootPath(); |
| 52 | 58 |
| 53 // Returns the path of the directory representing "My Drive". | 59 // Returns the path of the directory representing "My Drive". |
| 54 const base::FilePath& GetDriveMyDriveRootPath(); | 60 const base::FilePath& GetDriveMyDriveRootPath(); |
| 55 | 61 |
| 56 // Returns the Drive mount point path, which looks like "/special/drive". | 62 // Returns the Drive mount point path, which looks like "/special/drive". |
| 57 const base::FilePath& GetDriveMountPointPath(); | 63 const base::FilePath& GetDriveMountPointPath(); |
| 58 | 64 |
| 59 // Returns the FileSystem for the |profile|. If not available (not mounted | 65 // Returns the FileSystem for the |profile|. If not available (not mounted |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 73 // Returns the DriveAppRegistry for the |profile|. If not available (not | 79 // Returns the DriveAppRegistry for the |profile|. If not available (not |
| 74 // mounted or disabled), returns NULL. | 80 // mounted or disabled), returns NULL. |
| 75 DriveAppRegistry* GetDriveAppRegistryByProfile(Profile* profile); | 81 DriveAppRegistry* GetDriveAppRegistryByProfile(Profile* profile); |
| 76 | 82 |
| 77 // Returns the DriveService for the |profile|. If not available (not mounted | 83 // Returns the DriveService for the |profile|. If not available (not mounted |
| 78 // or disabled), returns NULL. | 84 // or disabled), returns NULL. |
| 79 DriveServiceInterface* GetDriveServiceByProfile(Profile* profile); | 85 DriveServiceInterface* GetDriveServiceByProfile(Profile* profile); |
| 80 | 86 |
| 81 // Checks if the resource ID is a special one, which is effective only in our | 87 // Checks if the resource ID is a special one, which is effective only in our |
| 82 // implementation and is not supposed to be sent to the server. | 88 // implementation and is not supposed to be sent to the server. |
| 83 bool IsSpecialResourceId(const std::string& resource_id); | 89 bool IsSpecialResourceId(const std::string& resource_id); |
|
kinaba
2013/11/12 02:10:27
I guess this functions should handle <trash> as a
kinaba
2013/11/12 02:10:27
And about "not supposed to be sent to the server",
hashimoto
2013/11/12 04:08:13
We shouldn't handle kDriveTrashDirId with this fun
| |
| 84 | 90 |
| 85 // Returns a ResourceEntry for "/drive/root" directory. | 91 // Returns a ResourceEntry for "/drive/root" directory. |
| 86 ResourceEntry CreateMyDriveRootEntry(const std::string& root_resource_id); | 92 ResourceEntry CreateMyDriveRootEntry(const std::string& root_resource_id); |
| 87 | 93 |
| 88 // Returns the Drive mount path as string. | 94 // Returns the Drive mount path as string. |
| 89 const std::string& GetDriveMountPointPathAsString(); | 95 const std::string& GetDriveMountPointPathAsString(); |
| 90 | 96 |
| 91 // Returns the gdata file resource url formatted as "drive:<path>" | 97 // Returns the gdata file resource url formatted as "drive:<path>" |
| 92 GURL FilePathToDriveURL(const base::FilePath& path); | 98 GURL FilePathToDriveURL(const base::FilePath& path); |
| 93 | 99 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 // Reads resource ID from a GDoc file. | 200 // Reads resource ID from a GDoc file. |
| 195 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path); | 201 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path); |
| 196 | 202 |
| 197 // Returns true if Drive is enabled for the given Profile. | 203 // Returns true if Drive is enabled for the given Profile. |
| 198 bool IsDriveEnabledForProfile(Profile* profile); | 204 bool IsDriveEnabledForProfile(Profile* profile); |
| 199 | 205 |
| 200 } // namespace util | 206 } // namespace util |
| 201 } // namespace drive | 207 } // namespace drive |
| 202 | 208 |
| 203 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 209 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
| OLD | NEW |