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

Side by Side Diff: chrome/browser/android/download/download_controller_base.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_DOWNLOAD_CONTROLLER_BASE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_ 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // downloads. 52 // downloads.
53 class DownloadControllerBase : public content::DownloadItem::Observer { 53 class DownloadControllerBase : public content::DownloadItem::Observer {
54 public: 54 public:
55 // Returns the singleton instance of the DownloadControllerBase. 55 // Returns the singleton instance of the DownloadControllerBase.
56 static DownloadControllerBase* Get(); 56 static DownloadControllerBase* Get();
57 57
58 // Called to set the DownloadControllerBase instance. 58 // Called to set the DownloadControllerBase instance.
59 static void SetDownloadControllerBase( 59 static void SetDownloadControllerBase(
60 DownloadControllerBase* download_controller); 60 DownloadControllerBase* download_controller);
61 61
62 // Starts a new download request with Android. Should be called on the
63 // UI thread.
64 virtual void CreateGETDownload(
65 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
66 bool must_download,
67 const DownloadInfo& info) = 0;
68
69 // Should be called when a download is started. It can be either a GET 62 // Should be called when a download is started. It can be either a GET
70 // request with authentication or a POST request. Notifies the embedding 63 // request with authentication or a POST request. Notifies the embedding
71 // app about the download. Should be called on the UI thread. 64 // app about the download. Should be called on the UI thread.
72 virtual void OnDownloadStarted(content::DownloadItem* download_item) = 0; 65 virtual void OnDownloadStarted(content::DownloadItem* download_item) = 0;
73 66
74 // Called when a download is initiated by context menu. 67 // Called when a download is initiated by context menu.
75 virtual void StartContextMenuDownload( 68 virtual void StartContextMenuDownload(
76 const content::ContextMenuParams& params, 69 const content::ContextMenuParams& params,
77 content::WebContents* web_contents, 70 content::WebContents* web_contents,
78 bool is_link, const std::string& extra_headers) = 0; 71 bool is_link, const std::string& extra_headers) = 0;
(...skipping 19 matching lines...) Expand all
98 // Called to set the default download file name if it cannot be resolved 91 // Called to set the default download file name if it cannot be resolved
99 // from url and content disposition 92 // from url and content disposition
100 virtual void SetDefaultDownloadFileName(const std::string& file_name) {} 93 virtual void SetDefaultDownloadFileName(const std::string& file_name) {}
101 94
102 protected: 95 protected:
103 ~DownloadControllerBase() override {} 96 ~DownloadControllerBase() override {}
104 static DownloadControllerBase* download_controller_; 97 static DownloadControllerBase* download_controller_;
105 }; 98 };
106 99
107 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_ 100 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698