Chromium Code Reviews| 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..5bb8b2fac066fc081d600d7908d83417e2f810d6 100644 |
| --- a/chrome/browser/android/download/chrome_download_delegate.h |
| +++ b/chrome/browser/android/download/chrome_download_delegate.h |
| @@ -6,16 +6,42 @@ |
| #define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_ |
| #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 Init(JNIEnv*, jobject obj); |
|
Ted C
2016/06/17 20:29:37
does this need to be public?
Jinsuk Kim
2016/06/20 02:00:53
Renamed to SetJavaRef. Yes it needs to be called f
|
| + |
| + 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); |
| + |
| + private: |
| + explicit ChromeDownloadDelegate(content::WebContents* contents); |
| + friend class content::WebContentsUserData<ChromeDownloadDelegate>; |
| + ~ChromeDownloadDelegate() override; |
| + |
| + // A reference to the Java ChromeDownloadDelegate object. |
| + jobject java_ref_; |
| }; |
| bool RegisterChromeDownloadDelegate(JNIEnv* env); |