| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 // Invokes |callback| on blocking thread pool, after converting virtual |path| | 138 // Invokes |callback| on blocking thread pool, after converting virtual |path| |
| 139 // string like "/special/drive/foo.txt" to the concrete local cache file path. | 139 // string like "/special/drive/foo.txt" to the concrete local cache file path. |
| 140 // After |callback| returns, the written content is synchronized to the server. | 140 // After |callback| returns, the written content is synchronized to the server. |
| 141 // | 141 // |
| 142 // The |path| must be a path under Drive. Must be called from UI thread. | 142 // The |path| must be a path under Drive. Must be called from UI thread. |
| 143 void PrepareWritableFileAndRun(Profile* profile, | 143 void PrepareWritableFileAndRun(Profile* profile, |
| 144 const base::FilePath& path, | 144 const base::FilePath& path, |
| 145 const PrepareWritableFileCallback& callback); | 145 const PrepareWritableFileCallback& callback); |
| 146 | 146 |
| 147 // Checks whether a directory exists at the given Drive path |directory|. | |
| 148 // Must be called from UI thread. The result will be called back to |callback|. | |
| 149 void CheckDirectoryExists(Profile* profile, | |
| 150 const base::FilePath& directory, | |
| 151 const FileOperationCallback& callback); | |
| 152 | |
| 153 // Ensures the existence of |directory| of '/special/drive/foo'. This will | 147 // Ensures the existence of |directory| of '/special/drive/foo'. This will |
| 154 // create |directory| and its ancestors if they don't exist. |callback| is | 148 // create |directory| and its ancestors if they don't exist. |callback| is |
| 155 // invoked after making sure that |directory| exists. |callback| should | 149 // invoked after making sure that |directory| exists. |callback| should |
| 156 // interpret error codes of either FILE_ERROR_OK or FILE_ERROR_EXISTS as | 150 // interpret error codes of either FILE_ERROR_OK or FILE_ERROR_EXISTS as |
| 157 // indicating that |directory| now exists. | 151 // indicating that |directory| now exists. |
| 158 // | 152 // |
| 159 // If |directory| is not a Drive path, it won't check the existence and just | 153 // If |directory| is not a Drive path, it won't check the existence and just |
| 160 // runs |callback|. | 154 // runs |callback|. |
| 161 // | 155 // |
| 162 // Must be called from UI thread. | 156 // Must be called from UI thread. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 DRIVE_CONNECTED, | 207 DRIVE_CONNECTED, |
| 214 }; | 208 }; |
| 215 | 209 |
| 216 // Returns the Drive connection status for the |profile|. | 210 // Returns the Drive connection status for the |profile|. |
| 217 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); | 211 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); |
| 218 | 212 |
| 219 } // namespace util | 213 } // namespace util |
| 220 } // namespace drive | 214 } // namespace drive |
| 221 | 215 |
| 222 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 216 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
| OLD | NEW |