Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/chromeos/drive/file_system/move_operation.h

Issue 12049062: Merge 177997 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 scoped_ptr<DriveEntryProto> entry_proto); 79 scoped_ptr<DriveEntryProto> entry_proto);
80 80
81 // Callback for handling resource rename attempt. Renames a file or 81 // Callback for handling resource rename attempt. Renames a file or
82 // directory at |file_path| on the client side. 82 // directory at |file_path| on the client side.
83 // |callback| must not be null. 83 // |callback| must not be null.
84 void RenameEntryLocally(const FilePath& file_path, 84 void RenameEntryLocally(const FilePath& file_path,
85 const FilePath::StringType& new_name, 85 const FilePath::StringType& new_name,
86 const FileMoveCallback& callback, 86 const FileMoveCallback& callback,
87 google_apis::GDataErrorCode status); 87 google_apis::GDataErrorCode status);
88 88
89 // Removes a file or directory at |file_path| from the current directory if 89 // Removes a file or directory at |file_path| from the current directory.
90 // it's not in the root directory. This essentially moves an entry to the 90 // It moves the entry to a dangle, no-parent state on the server side.
91 // root directory on the server side.
92 // 91 //
93 // Can be called from UI thread. |callback| is run on the calling thread. 92 // Can be called from UI thread. |callback| is run on the calling thread.
94 // |callback| must not be null. 93 // |callback| must not be null.
95 void RemoveEntryFromNonRootDirectory(const FileMoveCallback& callback, 94 void RemoveEntryFromDirectory(const FileMoveCallback& callback,
96 DriveFileError error, 95 DriveFileError error,
97 const FilePath& file_path); 96 const FilePath& file_path);
98 97
99 // Part of RemoveEntryFromNonRootDirectory(). Called after 98 // Part of RemoveEntryFromDirectory(). Called after
100 // GetEntryInfoPairByPaths() is complete. |callback| must not be null. 99 // GetEntryInfoPairByPaths() is complete. |callback| must not be null.
101 void RemoveEntryFromNonRootDirectoryAfterEntryInfoPair( 100 void RemoveEntryFromDirectoryAfterEntryInfoPair(
102 const FileMoveCallback& callback, 101 const FileMoveCallback& callback,
103 scoped_ptr<EntryInfoPairResult> result); 102 scoped_ptr<EntryInfoPairResult> result);
104 103
105 // Moves a file or directory at |file_path| in the root directory to 104 // Moves a file or directory at |file_path| to another directory at
106 // another directory at |dir_path|. This function does nothing if 105 // |dir_path|.
107 // |dir_path| points to the root directory.
108 // 106 //
109 // Can be called from UI thread. |callback| is run on the calling thread. 107 // Can be called from UI thread. |callback| is run on the calling thread.
110 // |callback| must not be null. 108 // |callback| must not be null.
111 void MoveEntryFromRootDirectory(const FilePath& directory_path, 109 void AddEntryToDirectory(const FilePath& directory_path,
112 const FileOperationCallback& callback, 110 const FileOperationCallback& callback,
113 DriveFileError error, 111 DriveFileError error,
114 const FilePath& file_path); 112 const FilePath& file_path);
115 113
116 // Part of MoveEntryFromRootDirectory(). Called after 114 // Part of AddEntryToDirectory(). Called after
117 // GetEntryInfoPairByPaths() is complete. |callback| must not be null. 115 // GetEntryInfoPairByPaths() is complete. |callback| must not be null.
118 void MoveEntryFromRootDirectoryAfterGetEntryInfoPair( 116 void AddEntryToDirectoryAfterGetEntryInfoPair(
119 const FileOperationCallback& callback, 117 const FileOperationCallback& callback,
120 scoped_ptr<EntryInfoPairResult> result); 118 scoped_ptr<EntryInfoPairResult> result);
121 119
122 // Moves entry specified by |file_path| to the directory specified by 120 // Moves entry specified by |file_path| to the directory specified by
123 // |dir_path| and calls |callback| asynchronously. 121 // |dir_path| and calls |callback| asynchronously.
124 // |callback| must not be null. 122 // |callback| must not be null.
125 void MoveEntryToDirectory(const FilePath& file_path, 123 void MoveEntryToDirectory(const FilePath& file_path,
126 const FilePath& directory_path, 124 const FilePath& directory_path,
127 const FileMoveCallback& callback, 125 const FileMoveCallback& callback,
128 google_apis::GDataErrorCode status); 126 google_apis::GDataErrorCode status);
(...skipping 23 matching lines...) Expand all
152 // invalidate the weak pointers before any other members are destroyed. 150 // invalidate the weak pointers before any other members are destroyed.
153 base::WeakPtrFactory<MoveOperation> weak_ptr_factory_; 151 base::WeakPtrFactory<MoveOperation> weak_ptr_factory_;
154 152
155 DISALLOW_COPY_AND_ASSIGN(MoveOperation); 153 DISALLOW_COPY_AND_ASSIGN(MoveOperation);
156 }; 154 };
157 155
158 } // namespace file_system 156 } // namespace file_system
159 } // namespace drive 157 } // namespace drive
160 158
161 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ 159 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698