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

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

Issue 15681009: Extract GetResolveFile into DownloadOperation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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_DRIVE_OPERATIONS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/chromeos/drive/file_system_interface.h" 9 #include "chrome/browser/chromeos/drive/file_system_interface.h"
10 10
(...skipping 13 matching lines...) Expand all
24 namespace internal { 24 namespace internal {
25 class FileCache; 25 class FileCache;
26 class ResourceMetadata; 26 class ResourceMetadata;
27 } // namespace internal 27 } // namespace internal
28 28
29 namespace file_system { 29 namespace file_system {
30 30
31 class CopyOperation; 31 class CopyOperation;
32 class CreateDirectoryOperation; 32 class CreateDirectoryOperation;
33 class CreateFileOperation; 33 class CreateFileOperation;
34 class DownloadOperation;
34 class MoveOperation; 35 class MoveOperation;
35 class OperationObserver; 36 class OperationObserver;
36 class RemoveOperation; 37 class RemoveOperation;
37 class SearchOperation; 38 class SearchOperation;
38 class UpdateOperation; 39 class UpdateOperation;
39 40
40 // Callback for DriveOperations::Search. 41 // Callback for DriveOperations::Search.
41 // On success, |error| is FILE_ERROR_OK, and remaining arguments are valid to 42 // On success, |error| is FILE_ERROR_OK, and remaining arguments are valid to
42 // use. if |is_update_needed| is true, some mismatch is found between 43 // use. if |is_update_needed| is true, some mismatch is found between
43 // the result from the server and local metadata, so the caller should update 44 // the result from the server and local metadata, so the caller should update
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 void Move(const base::FilePath& src_file_path, 105 void Move(const base::FilePath& src_file_path,
105 const base::FilePath& dest_file_path, 106 const base::FilePath& dest_file_path,
106 const FileOperationCallback& callback); 107 const FileOperationCallback& callback);
107 108
108 // Wrapper function for remove_operation_. 109 // Wrapper function for remove_operation_.
109 // |callback| must not be null. 110 // |callback| must not be null.
110 void Remove(const base::FilePath& file_path, 111 void Remove(const base::FilePath& file_path,
111 bool is_recursive, 112 bool is_recursive,
112 const FileOperationCallback& callback); 113 const FileOperationCallback& callback);
113 114
115 // Wrapper function for download_operation_.
116 // |completion_callback| must not be null.
117 void EnsureFileDownloaded(
118 const base::FilePath& file_path,
119 DriveClientContext context,
120 const GetFileContentInitializedCallback& initialized_callback,
121 const google_apis::GetContentCallback& get_content_callback,
122 const GetFileCallback& completion_callback);
123
114 // Wrapper function for update_operation_. 124 // Wrapper function for update_operation_.
115 // |callback| must not be null. 125 // |callback| must not be null.
116 void UpdateFileByResourceId(const std::string& resource_id, 126 void UpdateFileByResourceId(const std::string& resource_id,
117 DriveClientContext context, 127 DriveClientContext context,
118 const FileOperationCallback& callback); 128 const FileOperationCallback& callback);
119 129
120 // Wrapper function for search_operation_. 130 // Wrapper function for search_operation_.
121 // |callback| must not be null. 131 // |callback| must not be null.
122 void Search(const std::string& search_query, 132 void Search(const std::string& search_query,
123 const GURL& next_feed, 133 const GURL& next_feed,
124 const SearchOperationCallback& callback); 134 const SearchOperationCallback& callback);
125 135
126 private: 136 private:
127 scoped_ptr<CopyOperation> copy_operation_; 137 scoped_ptr<CopyOperation> copy_operation_;
128 scoped_ptr<CreateDirectoryOperation> create_directory_operation_; 138 scoped_ptr<CreateDirectoryOperation> create_directory_operation_;
129 scoped_ptr<CreateFileOperation> create_file_operation_; 139 scoped_ptr<CreateFileOperation> create_file_operation_;
130 scoped_ptr<MoveOperation> move_operation_; 140 scoped_ptr<MoveOperation> move_operation_;
131 scoped_ptr<RemoveOperation> remove_operation_; 141 scoped_ptr<RemoveOperation> remove_operation_;
142 scoped_ptr<DownloadOperation> download_operation_;
132 scoped_ptr<UpdateOperation> update_operation_; 143 scoped_ptr<UpdateOperation> update_operation_;
133 scoped_ptr<SearchOperation> search_operation_; 144 scoped_ptr<SearchOperation> search_operation_;
134 }; 145 };
135 146
136 } // namespace file_system 147 } // namespace file_system
137 } // namespace drive 148 } // namespace drive
138 149
139 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ 150 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698