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

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

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 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_H_ 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
11 #include "chrome/browser/android/download/download_controller_base.h" 11 #include "chrome/browser/android/download/download_controller_base.h"
12 12
13 namespace content { 13 namespace content {
14 class DownloadItem; 14 class DownloadItem;
15 class WebContents; 15 class WebContents;
16 } // namespace content 16 } // namespace content
17 17
18 namespace chrome { 18 namespace chrome {
19 namespace android { 19 namespace android {
20 20
21 // Mock implementation of the DownloadController. 21 // Mock implementation of the DownloadController.
22 class MockDownloadController : public DownloadControllerBase { 22 class MockDownloadController : public DownloadControllerBase {
23 public: 23 public:
24 MockDownloadController(); 24 MockDownloadController();
25 ~MockDownloadController() override; 25 ~MockDownloadController() override;
26 26
27 // DownloadControllerBase implementation. 27 // DownloadControllerBase implementation.
28 void CreateGETDownload(
29 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
30 bool must_download,
31 const DownloadInfo& info) override;
32 void OnDownloadStarted(content::DownloadItem* download_item) override; 28 void OnDownloadStarted(content::DownloadItem* download_item) override;
33 void StartContextMenuDownload( 29 void StartContextMenuDownload(
34 const content::ContextMenuParams& params, 30 const content::ContextMenuParams& params,
35 content::WebContents* web_contents, 31 content::WebContents* web_contents,
36 bool is_link, const std::string& extra_headers) override; 32 bool is_link, const std::string& extra_headers) override;
37 void DangerousDownloadValidated(content::WebContents* web_contents, 33 void DangerousDownloadValidated(content::WebContents* web_contents,
38 const std::string& download_guid, 34 const std::string& download_guid,
39 bool accept) override; 35 bool accept) override;
40 void AcquireFileAccessPermission( 36 void AcquireFileAccessPermission(
41 content::WebContents* web_contents, 37 content::WebContents* web_contents,
42 const AcquireFileAccessPermissionCallback& callback) override; 38 const AcquireFileAccessPermissionCallback& callback) override;
43 void SetApproveFileAccessRequestForTesting(bool approve) override; 39 void SetApproveFileAccessRequestForTesting(bool approve) override;
44 40
45 private: 41 private:
46 bool approve_file_access_request_; 42 bool approve_file_access_request_;
47 DISALLOW_COPY_AND_ASSIGN(MockDownloadController); 43 DISALLOW_COPY_AND_ASSIGN(MockDownloadController);
48 }; 44 };
49 45
50 } // namespace android 46 } // namespace android
51 } // namespace chrome 47 } // namespace chrome
52 48
53 49
54 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_H_ 50 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_MOCK_DOWNLOAD_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698