| 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 "chrome/browser/download/download_item.h" | 5 #include "chrome/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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 opened_(false), | 186 opened_(false), |
| 187 open_enabled_(true) { | 187 open_enabled_(true) { |
| 188 Init(true /* actively downloading */); | 188 Init(true /* actively downloading */); |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Constructing for the "Save Page As..." feature: | 191 // Constructing for the "Save Page As..." feature: |
| 192 DownloadItem::DownloadItem(DownloadManager* download_manager, | 192 DownloadItem::DownloadItem(DownloadManager* download_manager, |
| 193 const FilePath& path, | 193 const FilePath& path, |
| 194 const GURL& url, | 194 const GURL& url, |
| 195 bool is_otr) | 195 bool is_otr) |
| 196 : download_id_(1), | 196 : download_id_(download_manager->GetNextSavePageId()), |
| 197 full_path_(path), | 197 full_path_(path), |
| 198 url_chain_(1, url), | 198 url_chain_(1, url), |
| 199 referrer_url_(GURL()), | 199 referrer_url_(GURL()), |
| 200 total_bytes_(0), | 200 total_bytes_(0), |
| 201 received_bytes_(0), | 201 received_bytes_(0), |
| 202 last_os_error_(0), | 202 last_os_error_(0), |
| 203 start_tick_(base::TimeTicks::Now()), | 203 start_tick_(base::TimeTicks::Now()), |
| 204 state_(IN_PROGRESS), | 204 state_(IN_PROGRESS), |
| 205 start_time_(base::Time::Now()), | 205 start_time_(base::Time::Now()), |
| 206 db_handle_(DownloadHistory::kUninitializedHandle), | 206 db_handle_(DownloadHistory::kUninitializedHandle), |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 state_info_.target_name.value().c_str(), | 858 state_info_.target_name.value().c_str(), |
| 859 full_path().value().c_str()); | 859 full_path().value().c_str()); |
| 860 } else { | 860 } else { |
| 861 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); | 861 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); |
| 862 } | 862 } |
| 863 | 863 |
| 864 description += " }"; | 864 description += " }"; |
| 865 | 865 |
| 866 return description; | 866 return description; |
| 867 } | 867 } |
| OLD | NEW |