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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 const FilePath::StringType& new_name, | 351 const FilePath::StringType& new_name, |
352 const FileOperationCallback& callback); | 352 const FileOperationCallback& callback); |
353 | 353 |
354 // Renames a file or directory at |file_path| to |new_name| in the same | 354 // Renames a file or directory at |file_path| to |new_name| in the same |
355 // directory. |callback| will receive the new file path if the operation is | 355 // directory. |callback| will receive the new file path if the operation is |
356 // successful. If the new name already exists in the same directory, the file | 356 // successful. If the new name already exists in the same directory, the file |
357 // name is uniquified by adding a parenthesized serial number like | 357 // name is uniquified by adding a parenthesized serial number like |
358 // "foo (2).txt" | 358 // "foo (2).txt" |
359 // | 359 // |
360 // Can be called from UI thread. |callback| is run on the calling thread. | 360 // Can be called from UI thread. |callback| is run on the calling thread. |
| 361 // |callback| must not be null. |
361 void Rename(const FilePath& file_path, | 362 void Rename(const FilePath& file_path, |
362 const FilePath::StringType& new_name, | 363 const FilePath::StringType& new_name, |
363 const FileMoveCallback& callback); | 364 const FileMoveCallback& callback); |
364 | 365 |
365 // Part of Rename(). Called after GetEntryInfoByPath() is complete. | 366 // Part of Rename(). Called after GetEntryInfoByPath() is complete. |
366 void RenameAfterGetEntryInfo(const FilePath& file_path, | 367 void RenameAfterGetEntryInfo(const FilePath& file_path, |
367 const FilePath::StringType& new_name, | 368 const FilePath::StringType& new_name, |
368 const FileMoveCallback& callback, | 369 const FileMoveCallback& callback, |
369 GDataFileError error, | 370 GDataFileError error, |
370 scoped_ptr<GDataEntryProto> entry_proto); | 371 scoped_ptr<GDataEntryProto> entry_proto); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 GDataCache::FileOperationType cache_operation, | 741 GDataCache::FileOperationType cache_operation, |
741 const base::Closure& callback); | 742 const base::Closure& callback); |
742 | 743 |
743 // Part of CopyOnUIThread(). Called after GetEntryInfoPairByPaths() is | 744 // Part of CopyOnUIThread(). Called after GetEntryInfoPairByPaths() is |
744 // complete. | 745 // complete. |
745 void CopyOnUIThreadAfterGetEntryInfoPair( | 746 void CopyOnUIThreadAfterGetEntryInfoPair( |
746 const FilePath& dest_file_path, | 747 const FilePath& dest_file_path, |
747 const FileOperationCallback& callback, | 748 const FileOperationCallback& callback, |
748 scoped_ptr<EntryInfoPairResult> result); | 749 scoped_ptr<EntryInfoPairResult> result); |
749 | 750 |
| 751 // Part of MoveOnUIThread(). Called after GetEntryInfoPairByPaths() is |
| 752 // complete. |callback| must not be null. |
| 753 void MoveOnUIThreadAfterGetEntryInfoPair( |
| 754 const FilePath& dest_file_path, |
| 755 const FileOperationCallback& callback, |
| 756 scoped_ptr<EntryInfoPairResult> result); |
| 757 |
750 // Part of RemoveOnUIThread(). Called after GetEntryInfoByPath() is | 758 // Part of RemoveOnUIThread(). Called after GetEntryInfoByPath() is |
751 // complete. | 759 // complete. |
752 void RemoveOnUIThreadAfterGetEntryInfo( | 760 void RemoveOnUIThreadAfterGetEntryInfo( |
753 const FilePath& file_path, | 761 const FilePath& file_path, |
754 bool is_recursive, | 762 bool is_recursive, |
755 const FileOperationCallback& callback, | 763 const FileOperationCallback& callback, |
756 GDataFileError error, | 764 GDataFileError error, |
757 scoped_ptr<GDataEntryProto> entry_proto); | 765 scoped_ptr<GDataEntryProto> entry_proto); |
758 | 766 |
759 // Part of RequestDirectoryRefreshOnUIThread(). Called after | 767 // Part of RequestDirectoryRefreshOnUIThread(). Called after |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 // invalidate the weak pointers before any other members are destroyed. | 836 // invalidate the weak pointers before any other members are destroyed. |
829 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; | 837 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
830 // Unlike other classes, we need this as we need this to redirect a task | 838 // Unlike other classes, we need this as we need this to redirect a task |
831 // from IO thread to UI thread. | 839 // from IO thread to UI thread. |
832 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 840 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
833 }; | 841 }; |
834 | 842 |
835 } // namespace gdata | 843 } // namespace gdata |
836 | 844 |
837 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 845 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |