OLD | NEW |
| (Empty) |
1 // Copyright 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. | |
4 | |
5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_ | |
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_ | |
7 | |
8 #include "base/android/jni_android.h" | |
9 #include "content/public/browser/web_contents_user_data.h" | |
10 | |
11 class ChromeDownloadDelegate | |
12 : public content::WebContentsUserData<ChromeDownloadDelegate> { | |
13 public: | |
14 ~ChromeDownloadDelegate() override; | |
15 | |
16 // Returns true iff this request resulted in the tab creating the download | |
17 // to close. | |
18 static bool EnqueueDownloadManagerRequest(jobject chrome_download_delegate, | |
19 bool overwrite, | |
20 jobject download_info); | |
21 | |
22 void SetJavaRef(JNIEnv*, jobject obj); | |
23 | |
24 void RequestFileAccess(intptr_t callback_id); | |
25 | |
26 private: | |
27 explicit ChromeDownloadDelegate(content::WebContents* contents); | |
28 friend class content::WebContentsUserData<ChromeDownloadDelegate>; | |
29 | |
30 // A reference to the Java ChromeDownloadDelegate object. | |
31 jobject java_ref_; | |
32 }; | |
33 | |
34 bool RegisterChromeDownloadDelegate(JNIEnv* env); | |
35 | |
36 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_ | |
OLD | NEW |