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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 download_manager_(download_manager), | 175 download_manager_(download_manager), |
176 is_paused_(false), | 176 is_paused_(false), |
177 open_when_complete_(false), | 177 open_when_complete_(false), |
178 file_externally_removed_(false), | 178 file_externally_removed_(false), |
179 safety_state_(SAFE), | 179 safety_state_(SAFE), |
180 auto_opened_(false), | 180 auto_opened_(false), |
181 is_otr_(is_otr), | 181 is_otr_(is_otr), |
182 is_temporary_(!info.save_info.file_path.empty()), | 182 is_temporary_(!info.save_info.file_path.empty()), |
183 all_data_saved_(false), | 183 all_data_saved_(false), |
184 opened_(false), | 184 opened_(false), |
185 open_enabled_(true) { | 185 open_enabled_(true), |
| 186 delegate_delayed_complete_(false) { |
186 Init(true /* actively downloading */); | 187 Init(true /* actively downloading */); |
187 } | 188 } |
188 | 189 |
189 // Constructing for the "Save Page As..." feature: | 190 // Constructing for the "Save Page As..." feature: |
190 DownloadItem::DownloadItem(DownloadManager* download_manager, | 191 DownloadItem::DownloadItem(DownloadManager* download_manager, |
191 const FilePath& path, | 192 const FilePath& path, |
192 const GURL& url, | 193 const GURL& url, |
193 bool is_otr, | 194 bool is_otr, |
194 int download_id) | 195 int download_id) |
195 : download_id_(download_id), | 196 : download_id_(download_id), |
(...skipping 10 matching lines...) Expand all Loading... |
206 download_manager_(download_manager), | 207 download_manager_(download_manager), |
207 is_paused_(false), | 208 is_paused_(false), |
208 open_when_complete_(false), | 209 open_when_complete_(false), |
209 file_externally_removed_(false), | 210 file_externally_removed_(false), |
210 safety_state_(SAFE), | 211 safety_state_(SAFE), |
211 auto_opened_(false), | 212 auto_opened_(false), |
212 is_otr_(is_otr), | 213 is_otr_(is_otr), |
213 is_temporary_(false), | 214 is_temporary_(false), |
214 all_data_saved_(false), | 215 all_data_saved_(false), |
215 opened_(false), | 216 opened_(false), |
216 open_enabled_(true) { | 217 open_enabled_(true), |
| 218 delegate_delayed_complete_(false) { |
217 Init(true /* actively downloading */); | 219 Init(true /* actively downloading */); |
218 } | 220 } |
219 | 221 |
220 DownloadItem::~DownloadItem() { | 222 DownloadItem::~DownloadItem() { |
221 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. | 223 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. |
222 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 224 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
223 | 225 |
224 TransitionTo(REMOVING); | 226 TransitionTo(REMOVING); |
225 download_manager_->AssertQueueStateConsistent(this); | 227 download_manager_->AssertQueueStateConsistent(this); |
226 } | 228 } |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 state_info_.target_name.value().c_str(), | 799 state_info_.target_name.value().c_str(), |
798 full_path().value().c_str()); | 800 full_path().value().c_str()); |
799 } else { | 801 } else { |
800 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); | 802 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); |
801 } | 803 } |
802 | 804 |
803 description += " }"; | 805 description += " }"; |
804 | 806 |
805 return description; | 807 return description; |
806 } | 808 } |
OLD | NEW |