| 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 #include "chrome/browser/chromeos/drive/file_system/operations.h" | 5 #include "chrome/browser/chromeos/drive/file_system/operations.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h" | 8 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h
" | 9 #include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h
" |
| 10 #include "chrome/browser/chromeos/drive/file_system/create_file_operation.h" | 10 #include "chrome/browser/chromeos/drive/file_system/create_file_operation.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 const FileOperationCallback& callback) { | 149 const FileOperationCallback& callback) { |
| 150 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 150 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 151 DCHECK(!last_access_time.is_null()); | 151 DCHECK(!last_access_time.is_null()); |
| 152 DCHECK(!last_modified_time.is_null()); | 152 DCHECK(!last_modified_time.is_null()); |
| 153 DCHECK(!callback.is_null()); | 153 DCHECK(!callback.is_null()); |
| 154 | 154 |
| 155 touch_operation_->TouchFile( | 155 touch_operation_->TouchFile( |
| 156 file_path, last_access_time, last_modified_time, callback); | 156 file_path, last_access_time, last_modified_time, callback); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void Operations::EnsureFileDownloaded( | 159 void Operations::EnsureFileDownloadedByResourceId( |
| 160 const std::string& resource_id, |
| 161 const ClientContext& context, |
| 162 const GetFileContentInitializedCallback& initialized_callback, |
| 163 const google_apis::GetContentCallback& get_content_callback, |
| 164 const GetFileCallback& completion_callback) { |
| 165 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 166 DCHECK(!completion_callback.is_null()); |
| 167 |
| 168 download_operation_->EnsureFileDownloadedByResourceId( |
| 169 resource_id, context, initialized_callback, get_content_callback, |
| 170 completion_callback); |
| 171 } |
| 172 |
| 173 void Operations::EnsureFileDownloadedByPath( |
| 160 const base::FilePath& file_path, | 174 const base::FilePath& file_path, |
| 161 const ClientContext& context, | 175 const ClientContext& context, |
| 162 const GetFileContentInitializedCallback& initialized_callback, | 176 const GetFileContentInitializedCallback& initialized_callback, |
| 163 const google_apis::GetContentCallback& get_content_callback, | 177 const google_apis::GetContentCallback& get_content_callback, |
| 164 const GetFileCallback& completion_callback) { | 178 const GetFileCallback& completion_callback) { |
| 165 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 166 DCHECK(!completion_callback.is_null()); | 180 DCHECK(!completion_callback.is_null()); |
| 167 | 181 |
| 168 download_operation_->EnsureFileDownloaded( | 182 download_operation_->EnsureFileDownloadedByPath( |
| 169 file_path, context, initialized_callback, get_content_callback, | 183 file_path, context, initialized_callback, get_content_callback, |
| 170 completion_callback); | 184 completion_callback); |
| 171 } | 185 } |
| 172 | 186 |
| 173 void Operations::UpdateFileByResourceId( | 187 void Operations::UpdateFileByResourceId( |
| 174 const std::string& resource_id, | 188 const std::string& resource_id, |
| 175 const ClientContext& context, | 189 const ClientContext& context, |
| 176 const FileOperationCallback& callback) { | 190 const FileOperationCallback& callback) { |
| 177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 178 DCHECK(!callback.is_null()); | 192 DCHECK(!callback.is_null()); |
| 179 | 193 |
| 180 update_operation_->UpdateFileByResourceId(resource_id, context, callback); | 194 update_operation_->UpdateFileByResourceId(resource_id, context, callback); |
| 181 } | 195 } |
| 182 | 196 |
| 183 void Operations::Search(const std::string& search_query, | 197 void Operations::Search(const std::string& search_query, |
| 184 const GURL& next_feed, | 198 const GURL& next_feed, |
| 185 const SearchOperationCallback& callback) { | 199 const SearchOperationCallback& callback) { |
| 186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 200 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 187 DCHECK(!callback.is_null()); | 201 DCHECK(!callback.is_null()); |
| 188 | 202 |
| 189 search_operation_->Search(search_query, next_feed, callback); | 203 search_operation_->Search(search_query, next_feed, callback); |
| 190 } | 204 } |
| 191 | 205 |
| 192 } // namespace file_system | 206 } // namespace file_system |
| 193 } // namespace drive | 207 } // namespace drive |
| OLD | NEW |