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

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

Issue 12039005: drive: Deal with the root directory in the same way as others in MoveOperation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // Callback for handling resource rename attempt. Renames a file or 78 // Callback for handling resource rename attempt. Renames a file or
79 // directory at |file_path| on the client side. 79 // directory at |file_path| on the client side.
80 // |callback| must not be null. 80 // |callback| must not be null.
81 void RenameEntryLocally(const FilePath& file_path, 81 void RenameEntryLocally(const FilePath& file_path,
82 const FilePath::StringType& new_name, 82 const FilePath::StringType& new_name,
83 const FileMoveCallback& callback, 83 const FileMoveCallback& callback,
84 google_apis::GDataErrorCode status); 84 google_apis::GDataErrorCode status);
85 85
86 // Removes a file or directory at |file_path| from the current directory if 86 // Removes a file or directory at |file_path| from the current directory if
87 // it's not in the root directory. This essentially moves an entry to the 87 // it's not in the root directory. This essentially moves an entry to the
satorux1 2013/01/22 06:51:50 "if it's not in the root directory. " => remove th
kinaba 2013/01/22 07:09:10 Done.
88 // root directory on the server side. 88 // root directory on the server side.
89 // 89 //
90 // Can be called from UI thread. |callback| is run on the calling thread. 90 // Can be called from UI thread. |callback| is run on the calling thread.
91 // |callback| must not be null. 91 // |callback| must not be null.
92 void RemoveEntryFromNonRootDirectory(const FileMoveCallback& callback, 92 void RemoveEntryFromDirectory(const FileMoveCallback& callback,
93 DriveFileError error, 93 DriveFileError error,
94 const FilePath& file_path); 94 const FilePath& file_path);
95 95
96 // Part of RemoveEntryFromNonRootDirectory(). Called after 96 // Part of RemoveEntryFromDirectory(). Called after
97 // GetEntryInfoPairByPaths() is complete. |callback| must not be null. 97 // GetEntryInfoPairByPaths() is complete. |callback| must not be null.
98 void RemoveEntryFromNonRootDirectoryAfterEntryInfoPair( 98 void RemoveEntryFromDirectoryAfterEntryInfoPair(
99 const FileMoveCallback& callback, 99 const FileMoveCallback& callback,
100 scoped_ptr<EntryInfoPairResult> result); 100 scoped_ptr<EntryInfoPairResult> result);
101 101
102 // Moves a file or directory at |file_path| in the root directory to 102 // Moves a file or directory at |file_path| in the root directory to
satorux1 2013/01/22 06:51:50 "in the root directory " => remove this part?
kinaba 2013/01/22 07:09:10 Done.
103 // another directory at |dir_path|. This function does nothing if 103 // another directory at |dir_path|. This function does nothing if
104 // |dir_path| points to the root directory. 104 // |dir_path| points to the root directory.
105 // 105 //
106 // Can be called from UI thread. |callback| is run on the calling thread. 106 // Can be called from UI thread. |callback| is run on the calling thread.
107 // |callback| must not be null. 107 // |callback| must not be null.
108 void MoveEntryFromRootDirectory(const FilePath& directory_path, 108 void AddEntryToDirectory(const FilePath& directory_path,
109 const FileOperationCallback& callback, 109 const FileOperationCallback& callback,
110 DriveFileError error, 110 DriveFileError error,
111 const FilePath& file_path); 111 const FilePath& file_path);
112 112
113 // Part of MoveEntryFromRootDirectory(). Called after 113 // Part of AddEntryToDirectory(). Called after
114 // GetEntryInfoPairByPaths() is complete. |callback| must not be null. 114 // GetEntryInfoPairByPaths() is complete. |callback| must not be null.
115 void MoveEntryFromRootDirectoryAfterGetEntryInfoPair( 115 void AddEntryToDirectoryAfterGetEntryInfoPair(
116 const FileOperationCallback& callback, 116 const FileOperationCallback& callback,
117 scoped_ptr<EntryInfoPairResult> result); 117 scoped_ptr<EntryInfoPairResult> result);
118 118
119 // Moves entry specified by |file_path| to the directory specified by 119 // Moves entry specified by |file_path| to the directory specified by
120 // |dir_path| and calls |callback| asynchronously. 120 // |dir_path| and calls |callback| asynchronously.
121 // |callback| must not be null. 121 // |callback| must not be null.
122 void MoveEntryToDirectory(const FilePath& file_path, 122 void MoveEntryToDirectory(const FilePath& file_path,
123 const FilePath& directory_path, 123 const FilePath& directory_path,
124 const FileMoveCallback& callback, 124 const FileMoveCallback& callback,
125 google_apis::GDataErrorCode status); 125 google_apis::GDataErrorCode status);
(...skipping 23 matching lines...) Expand all
149 // invalidate the weak pointers before any other members are destroyed. 149 // invalidate the weak pointers before any other members are destroyed.
150 base::WeakPtrFactory<MoveOperation> weak_ptr_factory_; 150 base::WeakPtrFactory<MoveOperation> weak_ptr_factory_;
151 151
152 DISALLOW_COPY_AND_ASSIGN(MoveOperation); 152 DISALLOW_COPY_AND_ASSIGN(MoveOperation);
153 }; 153 };
154 154
155 } // namespace file_system 155 } // namespace file_system
156 } // namespace drive 156 } // namespace drive
157 157
158 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ 158 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698