Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Side by Side Diff: chrome/browser/android/download/mock_download_controller.cc

Issue 2371773003: Clean up Android DownloadManager code as most download now go through Chrome Network stack (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/android/download/mock_download_controller.h" 5 #include "chrome/browser/android/download/mock_download_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 10
11 namespace chrome { 11 namespace chrome {
12 namespace android { 12 namespace android {
13 13
14 MockDownloadController::MockDownloadController() 14 MockDownloadController::MockDownloadController()
15 : approve_file_access_request_(true) { 15 : approve_file_access_request_(true) {
16 } 16 }
17 17
18 MockDownloadController::~MockDownloadController() {} 18 MockDownloadController::~MockDownloadController() {}
19 19
20 void MockDownloadController::CreateGETDownload(
21 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
22 bool must_download, const DownloadInfo& info) {
23 }
24
25 void MockDownloadController::OnDownloadStarted( 20 void MockDownloadController::OnDownloadStarted(
26 content::DownloadItem* download_item) { 21 content::DownloadItem* download_item) {
27 } 22 }
28 23
29 void MockDownloadController::StartContextMenuDownload( 24 void MockDownloadController::StartContextMenuDownload(
30 const content::ContextMenuParams& params, 25 const content::ContextMenuParams& params,
31 content::WebContents* web_contents, 26 content::WebContents* web_contents,
32 bool is_link, const std::string& extra_headers) { 27 bool is_link, const std::string& extra_headers) {
33 } 28 }
34 29
35 void MockDownloadController::DangerousDownloadValidated( 30 void MockDownloadController::DangerousDownloadValidated(
36 content::WebContents* web_contents, 31 content::WebContents* web_contents,
37 const std::string& download_guid, 32 const std::string& download_guid,
38 bool accept) {} 33 bool accept) {}
39 34
40 void MockDownloadController::AcquireFileAccessPermission( 35 void MockDownloadController::AcquireFileAccessPermission(
41 content::WebContents* web_contents, 36 content::WebContents* web_contents,
42 const DownloadControllerBase::AcquireFileAccessPermissionCallback& cb) { 37 const DownloadControllerBase::AcquireFileAccessPermissionCallback& cb) {
43 base::ThreadTaskRunnerHandle::Get()->PostTask( 38 base::ThreadTaskRunnerHandle::Get()->PostTask(
44 FROM_HERE, base::Bind(cb, approve_file_access_request_)); 39 FROM_HERE, base::Bind(cb, approve_file_access_request_));
45 } 40 }
46 41
47 void MockDownloadController::SetApproveFileAccessRequestForTesting( 42 void MockDownloadController::SetApproveFileAccessRequestForTesting(
48 bool approve) { 43 bool approve) {
49 approve_file_access_request_ = approve; 44 approve_file_access_request_ = approve;
50 } 45 }
51 46
52 } // namespace android 47 } // namespace android
53 } // namespace chrome 48 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698