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_GDATA_GDATA_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 FILE_OPERATION_COPY, | 189 FILE_OPERATION_COPY, |
190 }; | 190 }; |
191 | 191 |
192 // Authenticates the user by fetching the auth token as | 192 // Authenticates the user by fetching the auth token as |
193 // needed. |callback| will be run with the error code and the auth | 193 // needed. |callback| will be run with the error code and the auth |
194 // token, on the thread this function is run. | 194 // token, on the thread this function is run. |
195 // | 195 // |
196 // Must be called on UI thread. | 196 // Must be called on UI thread. |
197 virtual void Authenticate(const AuthStatusCallback& callback) = 0; | 197 virtual void Authenticate(const AuthStatusCallback& callback) = 0; |
198 | 198 |
199 // Finds file info by using virtual |file_path|. This call will also | |
200 // retrieve and refresh file system content from server and disk cache. | |
201 // | |
202 // Can be called from UI/IO thread. |callback| is run on the calling thread. | |
203 virtual void FindEntryByPathAsync(const FilePath& file_path, | |
204 const FindEntryCallback& callback) = 0; | |
205 | |
206 // Finds file info by using |resource_id|. This call does not initiate | 199 // Finds file info by using |resource_id|. This call does not initiate |
207 // content refreshing and will invoke one of |delegate| methods directly as | 200 // content refreshing and will invoke one of |delegate| methods directly as |
208 // it executes. | 201 // it executes. |
209 // | 202 // |
210 // Can be called from UI/IO thread. |delegate| is run on the calling thread | 203 // Can be called from UI/IO thread. |delegate| is run on the calling thread |
211 // synchronously. | 204 // synchronously. |
212 virtual void FindEntryByResourceIdSync(const std::string& resource_id, | 205 virtual void FindEntryByResourceIdSync(const std::string& resource_id, |
213 FindEntryDelegate* delegate) = 0; | 206 FindEntryDelegate* delegate) = 0; |
214 | 207 |
215 // Initiates transfer of |local_file_path| to |remote_dest_file_path|. | 208 // Initiates transfer of |local_file_path| to |remote_dest_file_path|. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 public: | 394 public: |
402 GDataFileSystem(Profile* profile, | 395 GDataFileSystem(Profile* profile, |
403 DocumentsServiceInterface* documents_service); | 396 DocumentsServiceInterface* documents_service); |
404 virtual ~GDataFileSystem(); | 397 virtual ~GDataFileSystem(); |
405 | 398 |
406 // GDataFileSystem overrides. | 399 // GDataFileSystem overrides. |
407 virtual void Initialize() OVERRIDE; | 400 virtual void Initialize() OVERRIDE; |
408 virtual void AddObserver(Observer* observer) OVERRIDE; | 401 virtual void AddObserver(Observer* observer) OVERRIDE; |
409 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 402 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
410 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; | 403 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; |
411 virtual void FindEntryByPathAsync(const FilePath& file_path, | |
412 const FindEntryCallback& callback) OVERRIDE; | |
413 virtual void FindEntryByResourceIdSync(const std::string& resource_id, | 404 virtual void FindEntryByResourceIdSync(const std::string& resource_id, |
414 FindEntryDelegate* delegate) OVERRIDE; | 405 FindEntryDelegate* delegate) OVERRIDE; |
415 virtual void TransferFile(const FilePath& local_file_path, | 406 virtual void TransferFile(const FilePath& local_file_path, |
416 const FilePath& remote_dest_file_path, | 407 const FilePath& remote_dest_file_path, |
417 const FileOperationCallback& callback) OVERRIDE; | 408 const FileOperationCallback& callback) OVERRIDE; |
418 virtual void Copy(const FilePath& src_file_path, | 409 virtual void Copy(const FilePath& src_file_path, |
419 const FilePath& dest_file_path, | 410 const FilePath& dest_file_path, |
420 const FileOperationCallback& callback) OVERRIDE; | 411 const FileOperationCallback& callback) OVERRIDE; |
421 virtual void Move(const FilePath& src_file_path, | 412 virtual void Move(const FilePath& src_file_path, |
422 const FilePath& dest_file_path, | 413 const FilePath& dest_file_path, |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 base::PlatformFileError error, | 1248 base::PlatformFileError error, |
1258 const FilePath& directory_path, | 1249 const FilePath& directory_path, |
1259 GDataEntry* entry); | 1250 GDataEntry* entry); |
1260 | 1251 |
1261 // Called when an entry is found for ReadDirectoryByPathAsync(). | 1252 // Called when an entry is found for ReadDirectoryByPathAsync(). |
1262 void OnReadDirectory(const ReadDirectoryCallback& callback, | 1253 void OnReadDirectory(const ReadDirectoryCallback& callback, |
1263 base::PlatformFileError error, | 1254 base::PlatformFileError error, |
1264 const FilePath& directory_path, | 1255 const FilePath& directory_path, |
1265 GDataEntry* entry); | 1256 GDataEntry* entry); |
1266 | 1257 |
| 1258 // Finds file info by using virtual |file_path|. This call will also |
| 1259 // retrieve and refresh file system content from server and disk cache. |
| 1260 void FindEntryByPathAsyncOnUIThread(const FilePath& search_file_path, |
| 1261 const FindEntryCallback& callback); |
| 1262 |
1267 // The following functions are used to forward calls to asynchronous public | 1263 // The following functions are used to forward calls to asynchronous public |
1268 // member functions to UI thread. | 1264 // member functions to UI thread. |
1269 void FindEntryByPathAsyncOnUIThread(const FilePath& search_file_path, | |
1270 const FindEntryCallback& callback); | |
1271 void CopyOnUIThread(const FilePath& src_file_path, | 1265 void CopyOnUIThread(const FilePath& src_file_path, |
1272 const FilePath& dest_file_path, | 1266 const FilePath& dest_file_path, |
1273 const FileOperationCallback& callback); | 1267 const FileOperationCallback& callback); |
1274 void MoveOnUIThread(const FilePath& src_file_path, | 1268 void MoveOnUIThread(const FilePath& src_file_path, |
1275 const FilePath& dest_file_path, | 1269 const FilePath& dest_file_path, |
1276 const FileOperationCallback& callback); | 1270 const FileOperationCallback& callback); |
1277 void RemoveOnUIThread(const FilePath& file_path, | 1271 void RemoveOnUIThread(const FilePath& file_path, |
1278 bool is_recursive, | 1272 bool is_recursive, |
1279 const FileOperationCallback& callback); | 1273 const FileOperationCallback& callback); |
1280 void CreateDirectoryOnUIThread(const FilePath& directory_path, | 1274 void CreateDirectoryOnUIThread(const FilePath& directory_path, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 }; | 1364 }; |
1371 | 1365 |
1372 // Sets the free disk space getter for testing. | 1366 // Sets the free disk space getter for testing. |
1373 // The existing getter is deleted. | 1367 // The existing getter is deleted. |
1374 void SetFreeDiskSpaceGetterForTesting( | 1368 void SetFreeDiskSpaceGetterForTesting( |
1375 FreeDiskSpaceGetterInterface* getter); | 1369 FreeDiskSpaceGetterInterface* getter); |
1376 | 1370 |
1377 } // namespace gdata | 1371 } // namespace gdata |
1378 | 1372 |
1379 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1373 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |