| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/download/download_item.h" | 5 #include "content/browser/download/download_item.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/i18n/case_conversion.h" | 10 #include "base/i18n/case_conversion.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 if (IsInProgress()) | 147 if (IsInProgress()) |
| 148 state_ = CANCELLED; | 148 state_ = CANCELLED; |
| 149 if (IsComplete()) | 149 if (IsComplete()) |
| 150 all_data_saved_ = true; | 150 all_data_saved_ = true; |
| 151 Init(false /* not actively downloading */); | 151 Init(false /* not actively downloading */); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Constructing for a regular download: | 154 // Constructing for a regular download: |
| 155 DownloadItem::DownloadItem(DownloadManager* download_manager, | 155 DownloadItem::DownloadItem(DownloadManager* download_manager, |
| 156 const DownloadCreateInfo& info, | 156 const DownloadCreateInfo& info, |
| 157 const DownloadRequestHandle& request_handle, |
| 157 bool is_otr) | 158 bool is_otr) |
| 158 : state_info_(info.original_name, info.save_info.file_path, | 159 : state_info_(info.original_name, info.save_info.file_path, |
| 159 info.has_user_gesture, info.transition_type, | 160 info.has_user_gesture, info.transition_type, |
| 160 info.prompt_user_for_save_location, info.path_uniquifier, | 161 info.prompt_user_for_save_location, info.path_uniquifier, |
| 161 false, false), | 162 false, false), |
| 162 request_handle_(info.request_handle), | 163 request_handle_(request_handle), |
| 163 download_id_(info.download_id), | 164 download_id_(info.download_id), |
| 164 full_path_(info.path), | 165 full_path_(info.path), |
| 165 url_chain_(info.url_chain), | 166 url_chain_(info.url_chain), |
| 166 referrer_url_(info.referrer_url), | 167 referrer_url_(info.referrer_url), |
| 167 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), | 168 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), |
| 168 content_disposition_(info.content_disposition), | 169 content_disposition_(info.content_disposition), |
| 169 mime_type_(info.mime_type), | 170 mime_type_(info.mime_type), |
| 170 original_mime_type_(info.original_mime_type), | 171 original_mime_type_(info.original_mime_type), |
| 171 referrer_charset_(info.referrer_charset), | 172 referrer_charset_(info.referrer_charset), |
| 172 total_bytes_(info.total_bytes), | 173 total_bytes_(info.total_bytes), |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 state_info_.target_name.value().c_str(), | 812 state_info_.target_name.value().c_str(), |
| 812 full_path().value().c_str()); | 813 full_path().value().c_str()); |
| 813 } else { | 814 } else { |
| 814 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); | 815 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); |
| 815 } | 816 } |
| 816 | 817 |
| 817 description += " }"; | 818 description += " }"; |
| 818 | 819 |
| 819 return description; | 820 return description; |
| 820 } | 821 } |
| OLD | NEW |