| 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/google_apis/gdata_wapi_operations.h" | 5 #include "chrome/browser/google_apis/gdata_wapi_operations.h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 10 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 OPERATION_DOWNLOAD, | 184 OPERATION_DOWNLOAD, |
| 185 drive_file_path), | 185 drive_file_path), |
| 186 download_action_callback_(download_action_callback), | 186 download_action_callback_(download_action_callback), |
| 187 get_content_callback_(get_content_callback), | 187 get_content_callback_(get_content_callback), |
| 188 content_url_(content_url) { | 188 content_url_(content_url) { |
| 189 DCHECK(!download_action_callback_.is_null()); | 189 DCHECK(!download_action_callback_.is_null()); |
| 190 // get_content_callback may be null. | 190 // get_content_callback may be null. |
| 191 | 191 |
| 192 // Make sure we download the content into a temp file. | 192 // Make sure we download the content into a temp file. |
| 193 if (output_file_path.empty()) | 193 if (output_file_path.empty()) |
| 194 save_temp_file_ = true; | 194 set_save_temp_file(true); |
| 195 else | 195 else |
| 196 output_file_path_ = output_file_path; | 196 set_output_file_path(output_file_path); |
| 197 } | 197 } |
| 198 | 198 |
| 199 DownloadFileOperation::~DownloadFileOperation() {} | 199 DownloadFileOperation::~DownloadFileOperation() {} |
| 200 | 200 |
| 201 // Overridden from UrlFetchOperationBase. | 201 // Overridden from UrlFetchOperationBase. |
| 202 GURL DownloadFileOperation::GetURL() const { | 202 GURL DownloadFileOperation::GetURL() const { |
| 203 return content_url_; | 203 return content_url_; |
| 204 } | 204 } |
| 205 | 205 |
| 206 void DownloadFileOperation::OnURLFetchDownloadProgress(const URLFetcher* source, | 206 void DownloadFileOperation::OnURLFetchDownloadProgress(const URLFetcher* source, |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 return true; | 804 return true; |
| 805 } | 805 } |
| 806 | 806 |
| 807 void ResumeUploadOperation::OnURLFetchUploadProgress( | 807 void ResumeUploadOperation::OnURLFetchUploadProgress( |
| 808 const URLFetcher* source, int64 current, int64 total) { | 808 const URLFetcher* source, int64 current, int64 total) { |
| 809 // Adjust the progress values according to the range currently uploaded. | 809 // Adjust the progress values according to the range currently uploaded. |
| 810 NotifyProgress(params_.start_position + current, params_.content_length); | 810 NotifyProgress(params_.start_position + current, params_.content_length); |
| 811 } | 811 } |
| 812 | 812 |
| 813 } // namespace google_apis | 813 } // namespace google_apis |
| OLD | NEW |