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 // File method ordering: Methods in this file are in the same order as | 5 // File method ordering: Methods in this file are in the same order as |
6 // in download_item_impl.h, with the following exception: The public | 6 // in download_item_impl.h, with the following exception: The public |
7 // interface Start is placed in chronological order with the other | 7 // interface Start is placed in chronological order with the other |
8 // (private) routines that together define a DownloadItem's state | 8 // (private) routines that together define a DownloadItem's state |
9 // transitions as the download progresses. See "Download progression | 9 // transitions as the download progresses. See "Download progression |
10 // cascade" later in this file. | 10 // cascade" later in this file. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 DownloadInterruptReason interrupt_reason, | 126 DownloadInterruptReason interrupt_reason, |
127 bool opened, | 127 bool opened, |
128 const net::BoundNetLog& bound_net_log) | 128 const net::BoundNetLog& bound_net_log) |
129 : is_save_package_download_(false), | 129 : is_save_package_download_(false), |
130 download_id_(download_id), | 130 download_id_(download_id), |
131 current_path_(current_path), | 131 current_path_(current_path), |
132 target_path_(target_path), | 132 target_path_(target_path), |
133 target_disposition_(TARGET_DISPOSITION_OVERWRITE), | 133 target_disposition_(TARGET_DISPOSITION_OVERWRITE), |
134 url_chain_(url_chain), | 134 url_chain_(url_chain), |
135 referrer_url_(referrer_url), | 135 referrer_url_(referrer_url), |
136 transition_type_(PAGE_TRANSITION_LINK), | 136 transition_type_(ui::PAGE_TRANSITION_LINK), |
137 has_user_gesture_(false), | 137 has_user_gesture_(false), |
138 mime_type_(mime_type), | 138 mime_type_(mime_type), |
139 original_mime_type_(original_mime_type), | 139 original_mime_type_(original_mime_type), |
140 total_bytes_(total_bytes), | 140 total_bytes_(total_bytes), |
141 received_bytes_(received_bytes), | 141 received_bytes_(received_bytes), |
142 bytes_per_sec_(0), | 142 bytes_per_sec_(0), |
143 last_modified_time_(last_modified), | 143 last_modified_time_(last_modified), |
144 etag_(etag), | 144 etag_(etag), |
145 last_reason_(interrupt_reason), | 145 last_reason_(interrupt_reason), |
146 start_tick_(base::TimeTicks()), | 146 start_tick_(base::TimeTicks()), |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 scoped_ptr<DownloadRequestHandleInterface> request_handle, | 235 scoped_ptr<DownloadRequestHandleInterface> request_handle, |
236 const net::BoundNetLog& bound_net_log) | 236 const net::BoundNetLog& bound_net_log) |
237 : is_save_package_download_(true), | 237 : is_save_package_download_(true), |
238 request_handle_(request_handle.Pass()), | 238 request_handle_(request_handle.Pass()), |
239 download_id_(download_id), | 239 download_id_(download_id), |
240 current_path_(path), | 240 current_path_(path), |
241 target_path_(path), | 241 target_path_(path), |
242 target_disposition_(TARGET_DISPOSITION_OVERWRITE), | 242 target_disposition_(TARGET_DISPOSITION_OVERWRITE), |
243 url_chain_(1, url), | 243 url_chain_(1, url), |
244 referrer_url_(GURL()), | 244 referrer_url_(GURL()), |
245 transition_type_(PAGE_TRANSITION_LINK), | 245 transition_type_(ui::PAGE_TRANSITION_LINK), |
246 has_user_gesture_(false), | 246 has_user_gesture_(false), |
247 mime_type_(mime_type), | 247 mime_type_(mime_type), |
248 original_mime_type_(mime_type), | 248 original_mime_type_(mime_type), |
249 total_bytes_(0), | 249 total_bytes_(0), |
250 received_bytes_(0), | 250 received_bytes_(0), |
251 bytes_per_sec_(0), | 251 bytes_per_sec_(0), |
252 last_reason_(DOWNLOAD_INTERRUPT_REASON_NONE), | 252 last_reason_(DOWNLOAD_INTERRUPT_REASON_NONE), |
253 start_tick_(base::TimeTicks::Now()), | 253 start_tick_(base::TimeTicks::Now()), |
254 state_(IN_PROGRESS_INTERNAL), | 254 state_(IN_PROGRESS_INTERNAL), |
255 danger_type_(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS), | 255 danger_type_(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS), |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 } | 581 } |
582 | 582 |
583 std::string DownloadItemImpl::GetRemoteAddress() const { | 583 std::string DownloadItemImpl::GetRemoteAddress() const { |
584 return remote_address_; | 584 return remote_address_; |
585 } | 585 } |
586 | 586 |
587 bool DownloadItemImpl::HasUserGesture() const { | 587 bool DownloadItemImpl::HasUserGesture() const { |
588 return has_user_gesture_; | 588 return has_user_gesture_; |
589 }; | 589 }; |
590 | 590 |
591 PageTransition DownloadItemImpl::GetTransitionType() const { | 591 ui::PageTransition DownloadItemImpl::GetTransitionType() const { |
592 return transition_type_; | 592 return transition_type_; |
593 }; | 593 }; |
594 | 594 |
595 const std::string& DownloadItemImpl::GetLastModifiedTime() const { | 595 const std::string& DownloadItemImpl::GetLastModifiedTime() const { |
596 return last_modified_time_; | 596 return last_modified_time_; |
597 } | 597 } |
598 | 598 |
599 const std::string& DownloadItemImpl::GetETag() const { | 599 const std::string& DownloadItemImpl::GetETag() const { |
600 return etag_; | 600 return etag_; |
601 } | 601 } |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 case RESUME_MODE_USER_CONTINUE: | 1803 case RESUME_MODE_USER_CONTINUE: |
1804 return "USER_CONTINUE"; | 1804 return "USER_CONTINUE"; |
1805 case RESUME_MODE_USER_RESTART: | 1805 case RESUME_MODE_USER_RESTART: |
1806 return "USER_RESTART"; | 1806 return "USER_RESTART"; |
1807 } | 1807 } |
1808 NOTREACHED() << "Unknown resume mode " << mode; | 1808 NOTREACHED() << "Unknown resume mode " << mode; |
1809 return "unknown"; | 1809 return "unknown"; |
1810 } | 1810 } |
1811 | 1811 |
1812 } // namespace content | 1812 } // namespace content |
OLD | NEW |