| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/download/download_url_job.h" |
| 6 |
| 7 #include "content/public/browser/web_contents.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 DownloadUrlJob::DownloadUrlJob( |
| 12 std::unique_ptr<DownloadRequestHandleInterface> request_handle) |
| 13 : request_handle_(std::move(request_handle)) {} |
| 14 |
| 15 DownloadUrlJob::~DownloadUrlJob() = default; |
| 16 |
| 17 void DownloadUrlJob::Start() { |
| 18 InitializeDownloadFile(); |
| 19 } |
| 20 |
| 21 void DownloadUrlJob::Cancel(bool user_cancel) { |
| 22 if (request_handle_) |
| 23 request_handle_->CancelRequest(); |
| 24 } |
| 25 |
| 26 void DownloadUrlJob::Pause() { |
| 27 if (request_handle_) |
| 28 request_handle_->PauseRequest(); |
| 29 } |
| 30 |
| 31 void DownloadUrlJob::Resume() { |
| 32 if (request_handle_) |
| 33 request_handle_->ResumeRequest(); |
| 34 } |
| 35 |
| 36 WebContents* DownloadUrlJob::GetWebContents() const { |
| 37 return request_handle_ ? request_handle_->GetWebContents() : nullptr; |
| 38 } |
| 39 |
| 40 } // namespace content |
| OLD | NEW |