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

Unified Diff: chrome/browser/android/download/chrome_download_delegate.h

Issue 2014803002: Move DownloadControllerAndroid from content/ to chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved DownloadControllerAndroid(Impl) to chrome/ Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/download/chrome_download_delegate.h
diff --git a/chrome/browser/android/download/chrome_download_delegate.h b/chrome/browser/android/download/chrome_download_delegate.h
index 1ad717c45da315fa9cc5828076ac4c8cdba1d1cf..ce2bac6228dd7c98789e7d381003e087d93e40f6 100644
--- a/chrome/browser/android/download/chrome_download_delegate.h
+++ b/chrome/browser/android/download/chrome_download_delegate.h
@@ -7,15 +7,42 @@
#include "base/android/jni_android.h"
#include "base/android/jni_weak_ref.h"
-#include "base/android/scoped_java_ref.h"
+#include "content/public/browser/web_contents_user_data.h"
-class ChromeDownloadDelegate {
+class ChromeDownloadDelegate
+ : public content::WebContentsUserData<ChromeDownloadDelegate> {
public:
// Returns true iff this request resulted in the tab creating the download
// to close.
static bool EnqueueDownloadManagerRequest(jobject chrome_download_delegate,
bool overwrite,
jobject download_info);
+
+ void RequestHTTPGetDownload(const std::string& url,
+ const std::string& user_agent,
+ const std::string& content_disposition,
+ const std::string& mime_type,
+ const std::string& cookie,
+ const std::string& referer,
+ const base::string16& file_name,
+ int64_t content_length,
+ bool has_user_geature,
+ bool must_download);
+ void OnDownloadStarted(const std::string& filename,
+ const std::string& mime_type);
+ void OnDangerousDownload(const std::string& filename,
+ const std::string& guid);
+ void RequestFileAccess(intptr_t callback_id);
+
+ void SetDelegate(JNIEnv*, jobject obj);
+
+ ~ChromeDownloadDelegate() override;
no sievers 2016/06/07 21:35:22 nit: I think the destructor can be private too sin
Jinsuk Kim 2016/06/08 06:29:08 Done.
+
+ private:
+ explicit ChromeDownloadDelegate(content::WebContents* contents);
+ friend class content::WebContentsUserData<ChromeDownloadDelegate>;
+
+ JavaObjectWeakGlobalRef weak_java_ref_;
no sievers 2016/06/07 21:35:23 I think that pattern makes sense for a delegate (w
Jinsuk Kim 2016/06/08 06:29:08 Done.
};
bool RegisterChromeDownloadDelegate(JNIEnv* env);

Powered by Google App Engine
This is Rietveld 408576698