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
3 // found in the LICENSE file.
5 #include "chrome/browser/android/download/mock_download_controller_android.h"
8 #include "base/location.h"
9 #include "base/thread_task_runner_handle.h"
11 using content::DownloadControllerAndroid
;
16 MockDownloadControllerAndroid::MockDownloadControllerAndroid()
17 : approve_file_access_request_(true) {
20 MockDownloadControllerAndroid::~MockDownloadControllerAndroid() {}
22 void MockDownloadControllerAndroid::CreateGETDownload(
23 int render_process_id
, int render_view_id
, int request_id
) {
26 void MockDownloadControllerAndroid::OnDownloadStarted(
27 content::DownloadItem
* download_item
) {
30 void MockDownloadControllerAndroid::StartContextMenuDownload(
31 const content::ContextMenuParams
& params
,
32 content::WebContents
* web_contents
,
33 bool is_link
, const std::string
& extra_headers
) {
36 void MockDownloadControllerAndroid::DangerousDownloadValidated(
37 content::WebContents
* web_contents
, int download_id
, bool accept
) {
40 void MockDownloadControllerAndroid::AcquireFileAccessPermission(
41 int render_process_id
,
43 const DownloadControllerAndroid::AcquireFileAccessPermissionCallback
& cb
) {
44 base::ThreadTaskRunnerHandle::Get()->PostTask(
45 FROM_HERE
, base::Bind(cb
, approve_file_access_request_
));
48 void MockDownloadControllerAndroid::SetApproveFileAccessRequestForTesting(
50 approve_file_access_request_
= approve
;
53 } // namespace android