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

Unified Diff: content/browser/android/download_controller_android_impl.h

Issue 1217223006: Prompt user for file access permission before download starts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 5 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
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/browser/android/download_controller_android_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/download_controller_android_impl.h
diff --git a/content/browser/android/download_controller_android_impl.h b/content/browser/android/download_controller_android_impl.h
index fad2320e5d21c816e53d8bb373b44234c1773425..2363d46d34a2c406bb71e812f6cfd3603c03cd57 100644
--- a/content/browser/android/download_controller_android_impl.h
+++ b/content/browser/android/download_controller_android_impl.h
@@ -54,6 +54,11 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid,
// Removes a deferred download from |deferred_downloads_|.
void CancelDeferredDownload(DeferredDownloadObserver* observer);
+ // DownloadControllerAndroid implementation.
+ void AcquireFileAccessPermission(
+ WebContents* web_contents,
+ const AcquireFileAccessPermissionCallback& callback) override;
+
private:
// Used to store all the information about an Android download.
struct DownloadInfoAndroid {
@@ -81,6 +86,10 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid,
DownloadControllerAndroidImpl();
~DownloadControllerAndroidImpl() override;
+ // Helper method for implementing AcquireFileAccessPermission().
+ bool HasFileAccessPermission(
+ base::android::ScopedJavaLocalRef<jobject> j_content_view_core);
+
// DownloadControllerAndroid implementation.
void CreateGETDownload(int render_process_id,
int render_view_id,
@@ -116,6 +125,10 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid,
void StartAndroidDownload(int render_process_id,
int render_view_id,
const DownloadInfoAndroid& info);
+ void StartAndroidDownloadInternal(int render_process_id,
+ int render_view_id,
+ const DownloadInfoAndroid& info,
+ bool allowed);
// The download item contains dangerous file types.
void OnDangerousDownload(DownloadItem *item);
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/browser/android/download_controller_android_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698