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_MOVE_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class MoveOperation { | 31 class MoveOperation { |
32 public: | 32 public: |
33 MoveOperation(DriveServiceInterface* drive_service, | 33 MoveOperation(DriveServiceInterface* drive_service, |
34 DriveResourceMetadata* metadata, | 34 DriveResourceMetadata* metadata, |
35 OperationObserver* observer); | 35 OperationObserver* observer); |
36 virtual ~MoveOperation(); | 36 virtual ~MoveOperation(); |
37 | 37 |
38 // Performs the move operation on the file at drive path |src_file_path| | 38 // Performs the move operation on the file at drive path |src_file_path| |
39 // with a target of |dest_file_path|. Invokes |callback| when finished with | 39 // with a target of |dest_file_path|. Invokes |callback| when finished with |
40 // the result of the operation. | 40 // the result of the operation. |
41 void Move(const FilePath& src_file_path, | 41 virtual void Move(const FilePath& src_file_path, |
42 const FilePath& dest_file_path, | 42 const FilePath& dest_file_path, |
43 const FileOperationCallback& callback); | 43 const FileOperationCallback& callback); |
44 private: | 44 private: |
45 // Part of Move(). Called after GetEntryInfoPairByPaths() is | 45 // Part of Move(). Called after GetEntryInfoPairByPaths() is |
46 // complete. |callback| must not be null. | 46 // complete. |callback| must not be null. |
47 void MoveAfterGetEntryInfoPair( | 47 void MoveAfterGetEntryInfoPair( |
48 const FilePath& dest_file_path, | 48 const FilePath& dest_file_path, |
49 const FileOperationCallback& callback, | 49 const FileOperationCallback& callback, |
50 scoped_ptr<EntryInfoPairResult> result); | 50 scoped_ptr<EntryInfoPairResult> result); |
51 | 51 |
52 // A pass-through callback used for bridging from | 52 // A pass-through callback used for bridging from |
53 // FileMoveCallback to FileOperationCallback. | 53 // FileMoveCallback to FileOperationCallback. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // invalidate the weak pointers before any other members are destroyed. | 151 // invalidate the weak pointers before any other members are destroyed. |
152 base::WeakPtrFactory<MoveOperation> weak_ptr_factory_; | 152 base::WeakPtrFactory<MoveOperation> weak_ptr_factory_; |
153 | 153 |
154 DISALLOW_COPY_AND_ASSIGN(MoveOperation); | 154 DISALLOW_COPY_AND_ASSIGN(MoveOperation); |
155 }; | 155 }; |
156 | 156 |
157 } // namespace file_system | 157 } // namespace file_system |
158 } // namespace drive | 158 } // namespace drive |
159 | 159 |
160 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ | 160 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ |
OLD | NEW |