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

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

Issue 2496983003: Use native implementation of dangerous download infobar (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/android/download/chrome_download_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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_CHROME_DOWNLOAD_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_ 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "content/public/browser/web_contents_user_data.h" 9 #include "content/public/browser/web_contents_user_data.h"
10 10
11 class ChromeDownloadDelegate 11 class ChromeDownloadDelegate
12 : public content::WebContentsUserData<ChromeDownloadDelegate> { 12 : public content::WebContentsUserData<ChromeDownloadDelegate> {
13 public: 13 public:
14 // Returns true iff this request resulted in the tab creating the download 14 // Returns true iff this request resulted in the tab creating the download
15 // to close. 15 // to close.
16 static bool EnqueueDownloadManagerRequest(jobject chrome_download_delegate, 16 static bool EnqueueDownloadManagerRequest(jobject chrome_download_delegate,
17 bool overwrite, 17 bool overwrite,
18 jobject download_info); 18 jobject download_info);
19 19
20 void SetJavaRef(JNIEnv*, jobject obj); 20 void SetJavaRef(JNIEnv*, jobject obj);
21 21
22 void OnDownloadStarted(const std::string& filename); 22 void OnDownloadStarted(const std::string& filename);
23 void OnDangerousDownload(const std::string& filename,
24 const std::string& guid);
25 void RequestFileAccess(intptr_t callback_id); 23 void RequestFileAccess(intptr_t callback_id);
26 24
27 private: 25 private:
28 explicit ChromeDownloadDelegate(content::WebContents* contents); 26 explicit ChromeDownloadDelegate(content::WebContents* contents);
29 friend class content::WebContentsUserData<ChromeDownloadDelegate>; 27 friend class content::WebContentsUserData<ChromeDownloadDelegate>;
30 ~ChromeDownloadDelegate() override; 28 ~ChromeDownloadDelegate() override;
31 29
32 // A reference to the Java ChromeDownloadDelegate object. 30 // A reference to the Java ChromeDownloadDelegate object.
33 jobject java_ref_; 31 jobject java_ref_;
34 }; 32 };
35 33
36 bool RegisterChromeDownloadDelegate(JNIEnv* env); 34 bool RegisterChromeDownloadDelegate(JNIEnv* env);
37 35
38 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_ 36 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/android/download/chrome_download_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698