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 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_ANDROID_H_
8 #include "base/callback.h"
9 #include "base/memory/singleton.h"
10 #include "content/public/browser/android/download_controller_android.h"
15 } // namespace content
20 // Mock implementation of the DownloadControllerAndroid.
21 class MockDownloadControllerAndroid
22 : public content::DownloadControllerAndroid
{
24 MockDownloadControllerAndroid();
25 ~MockDownloadControllerAndroid() override
;
27 // DownloadControllerAndroid implementation.
28 void CreateGETDownload(int render_process_id
, int render_view_id
,
29 int request_id
) override
;
30 void OnDownloadStarted(content::DownloadItem
* download_item
) override
;
31 void StartContextMenuDownload(
32 const content::ContextMenuParams
& params
,
33 content::WebContents
* web_contents
,
34 bool is_link
, const std::string
& extra_headers
) override
;
35 void DangerousDownloadValidated(
36 content::WebContents
* web_contents
, int download_id
,
37 bool accept
) override
;
38 void AcquireFileAccessPermission(
39 int render_process_id
,
41 const AcquireFileAccessPermissionCallback
& callback
) override
;
42 void SetApproveFileAccessRequestForTesting(bool approve
) override
;
45 bool approve_file_access_request_
;
46 DISALLOW_COPY_AND_ASSIGN(MockDownloadControllerAndroid
);
49 } // namespace android
53 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_ANDROID_H_