| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/public/test/fake_download_item.h" | 5 #include "content/public/test/fake_download_item.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "net/http/http_response_headers.h" |
| 8 | 9 |
| 9 namespace content { | 10 namespace content { |
| 10 | 11 |
| 11 FakeDownloadItem::FakeDownloadItem() = default; | 12 FakeDownloadItem::FakeDownloadItem() = default; |
| 12 | 13 |
| 13 FakeDownloadItem::~FakeDownloadItem() { | 14 FakeDownloadItem::~FakeDownloadItem() { |
| 14 NotifyDownloadRemoved(); | 15 NotifyDownloadRemoved(); |
| 15 NotifyDownloadDestroyed(); | 16 NotifyDownloadDestroyed(); |
| 16 } | 17 } |
| 17 | 18 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 120 } |
| 120 | 121 |
| 121 void FakeDownloadItem::SetState(const DownloadState& state) { | 122 void FakeDownloadItem::SetState(const DownloadState& state) { |
| 122 download_state_ = state; | 123 download_state_ = state; |
| 123 } | 124 } |
| 124 | 125 |
| 125 DownloadItem::DownloadState FakeDownloadItem::GetState() const { | 126 DownloadItem::DownloadState FakeDownloadItem::GetState() const { |
| 126 return download_state_; | 127 return download_state_; |
| 127 } | 128 } |
| 128 | 129 |
| 130 void FakeDownloadItem::SetResponseHeaders( |
| 131 scoped_refptr<const net::HttpResponseHeaders> response_headers) { |
| 132 response_headers_ = response_headers; |
| 133 } |
| 134 |
| 135 const scoped_refptr<const net::HttpResponseHeaders>& |
| 136 FakeDownloadItem::GetResponseHeaders() const { |
| 137 return response_headers_; |
| 138 } |
| 139 |
| 129 void FakeDownloadItem::SetMimeType(const std::string& mime_type) { | 140 void FakeDownloadItem::SetMimeType(const std::string& mime_type) { |
| 130 mime_type_ = mime_type; | 141 mime_type_ = mime_type; |
| 131 } | 142 } |
| 132 | 143 |
| 133 std::string FakeDownloadItem::GetMimeType() const { | 144 std::string FakeDownloadItem::GetMimeType() const { |
| 134 return mime_type_; | 145 return mime_type_; |
| 135 } | 146 } |
| 136 | 147 |
| 137 void FakeDownloadItem::SetOriginalUrl(const GURL& url) { | 148 void FakeDownloadItem::SetOriginalUrl(const GURL& url) { |
| 138 original_url_ = url; | 149 original_url_ = url; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 void FakeDownloadItem::SetDisplayName(const base::FilePath& name) { | 422 void FakeDownloadItem::SetDisplayName(const base::FilePath& name) { |
| 412 NOTREACHED(); | 423 NOTREACHED(); |
| 413 } | 424 } |
| 414 | 425 |
| 415 std::string FakeDownloadItem::DebugString(bool verbose) const { | 426 std::string FakeDownloadItem::DebugString(bool verbose) const { |
| 416 NOTREACHED(); | 427 NOTREACHED(); |
| 417 return std::string(); | 428 return std::string(); |
| 418 } | 429 } |
| 419 | 430 |
| 420 } // namespace content | 431 } // namespace content |
| OLD | NEW |