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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 const FilePath::StringType& new_name, | 366 const FilePath::StringType& new_name, |
367 const FileMoveCallback& callback); | 367 const FileMoveCallback& callback); |
368 | 368 |
369 // Part of Rename(). Called after GetEntryInfoByPath() is complete. | 369 // Part of Rename(). Called after GetEntryInfoByPath() is complete. |
370 void RenameAfterGetEntryInfo(const FilePath& file_path, | 370 void RenameAfterGetEntryInfo(const FilePath& file_path, |
371 const FilePath::StringType& new_name, | 371 const FilePath::StringType& new_name, |
372 const FileMoveCallback& callback, | 372 const FileMoveCallback& callback, |
373 GDataFileError error, | 373 GDataFileError error, |
374 scoped_ptr<GDataEntryProto> entry_proto); | 374 scoped_ptr<GDataEntryProto> entry_proto); |
375 | 375 |
376 // Adds a file or directory at |file_path| to the directory at |dir_path|. | 376 // Moves a file or directory at |file_path| in the root directory to |
377 // another directory at |dir_path|. This function does nothing if | |
378 // |dir_path| points to the root directory. | |
377 // | 379 // |
378 // Can be called from UI thread. |callback| is run on the calling thread. | 380 // Can be called from UI thread. |callback| is run on the calling thread. |
379 void AddEntryToDirectory(const FilePath& dir_path, | 381 // |callback| must not be null. |
380 const FileOperationCallback& callback, | 382 void MoveEntryFromRootDirectory(const FilePath& dir_path, |
381 GDataFileError error, | 383 const FileOperationCallback& callback, |
382 const FilePath& file_path); | 384 GDataFileError error, |
385 const FilePath& file_path); | |
383 | 386 |
384 // Removes a file or directory at |file_path| from the directory at | 387 // Removes a file or directory at |file_path| from the directory at |
385 // |dir_path| and moves it to the root directory. | 388 // |dir_path| and moves it to the root directory. |
386 // | 389 // |
387 // Can be called from UI thread. |callback| is run on the calling thread. | 390 // Can be called from UI thread. |callback| is run on the calling thread. |
388 void RemoveEntryFromDirectory(const FilePath& dir_path, | 391 void RemoveEntryFromDirectory(const FilePath& dir_path, |
389 const FileMoveCallback& callback, | 392 const FileMoveCallback& callback, |
390 GDataFileError error, | 393 GDataFileError error, |
391 const FilePath& file_path); | 394 const FilePath& file_path); |
392 | 395 |
(...skipping 22 matching lines...) Expand all Loading... | |
415 const std::string& md5, | 418 const std::string& md5, |
416 const FilePath& cache_file_path); | 419 const FilePath& cache_file_path); |
417 | 420 |
418 // Callback for handling document copy attempt. | 421 // Callback for handling document copy attempt. |
419 // |callback| must not be null. | 422 // |callback| must not be null. |
420 void OnCopyDocumentCompleted(const FilePath& dir_path, | 423 void OnCopyDocumentCompleted(const FilePath& dir_path, |
421 const FileOperationCallback& callback, | 424 const FileOperationCallback& callback, |
422 GDataErrorCode status, | 425 GDataErrorCode status, |
423 scoped_ptr<base::Value> data); | 426 scoped_ptr<base::Value> data); |
424 | 427 |
425 // Callback for handling an attempt to add a file or directory to another | 428 // Callback for handling an attempt to move a file or directory from the |
426 // directory. | 429 // root directory to another directory. |
achuithb
2012/08/09 21:32:42
Maybe also state that this calls GDataDirectorySer
satorux1
2012/08/09 21:50:54
You meant GDataDirectoryService::MoveEntryToDirec
achuithb
2012/08/09 22:42:34
Yup, sorry.
| |
427 void OnAddEntryToDirectoryCompleted(const FileOperationCallback& callback, | 430 // |callback| must not be null. |
428 const FilePath& file_path, | 431 void OnMoveEntryFromRootDirectoryCompleted( |
429 const FilePath& dir_path, | 432 const FileOperationCallback& callback, |
430 GDataErrorCode status, | 433 const FilePath& file_path, |
431 const GURL& document_url); | 434 const FilePath& dir_path, |
435 GDataErrorCode status, | |
436 const GURL& document_url); | |
432 | 437 |
433 // Callback for handling account metadata fetch. | 438 // Callback for handling account metadata fetch. |
434 void OnGetAvailableSpace( | 439 void OnGetAvailableSpace( |
435 const GetAvailableSpaceCallback& callback, | 440 const GetAvailableSpaceCallback& callback, |
436 GDataErrorCode status, | 441 GDataErrorCode status, |
437 scoped_ptr<base::Value> data); | 442 scoped_ptr<base::Value> data); |
438 | 443 |
439 // Callback for handling Drive V2 about resource fetch. | 444 // Callback for handling Drive V2 about resource fetch. |
440 void OnGetAboutResource( | 445 void OnGetAboutResource( |
441 const GetAvailableSpaceCallback& callback, | 446 const GetAvailableSpaceCallback& callback, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
508 | 513 |
509 // Callback for GDataDirectoryService::MoveEntryToDirectory with | 514 // Callback for GDataDirectoryService::MoveEntryToDirectory with |
510 // FileMoveCallback. | 515 // FileMoveCallback. |
511 void OnMoveEntryToDirectoryWithFileMoveCallback( | 516 void OnMoveEntryToDirectoryWithFileMoveCallback( |
512 const FileMoveCallback& callback, | 517 const FileMoveCallback& callback, |
513 GDataFileError error, | 518 GDataFileError error, |
514 const FilePath& moved_file_path); | 519 const FilePath& moved_file_path); |
515 | 520 |
516 // Callback for GDataDirectoryService::MoveEntryToDirectory with | 521 // Callback for GDataDirectoryService::MoveEntryToDirectory with |
517 // FileOperationCallback. | 522 // FileOperationCallback. |
523 // |callback| must not be null. | |
518 void OnMoveEntryToDirectoryWithFileOperationCallback( | 524 void OnMoveEntryToDirectoryWithFileOperationCallback( |
519 const FileOperationCallback& callback, | 525 const FileOperationCallback& callback, |
520 GDataFileError error, | 526 GDataFileError error, |
521 const FilePath& moved_file_path); | 527 const FilePath& moved_file_path); |
522 | 528 |
523 // Callback for GetEntryByResourceIdAsync. | 529 // Callback for GetEntryByResourceIdAsync. |
524 // Removes stale entry upon upload of file. | 530 // Removes stale entry upon upload of file. |
525 static void RemoveStaleEntryOnUpload(const std::string& resource_id, | 531 static void RemoveStaleEntryOnUpload(const std::string& resource_id, |
526 GDataDirectory* parent_dir, | 532 GDataDirectory* parent_dir, |
527 GDataEntry* existing_entry); | 533 GDataEntry* existing_entry); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
840 // invalidate the weak pointers before any other members are destroyed. | 846 // invalidate the weak pointers before any other members are destroyed. |
841 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; | 847 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
842 // Unlike other classes, we need this as we need this to redirect a task | 848 // Unlike other classes, we need this as we need this to redirect a task |
843 // from IO thread to UI thread. | 849 // from IO thread to UI thread. |
844 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 850 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
845 }; | 851 }; |
846 | 852 |
847 } // namespace gdata | 853 } // namespace gdata |
848 | 854 |
849 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 855 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |