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

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: Created 5 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: 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..4cf73e79eb9e2a49682ab32159db9d7c5c901332 100644
--- a/content/browser/android/download_controller_android_impl.h
+++ b/content/browser/android/download_controller_android_impl.h
@@ -54,6 +54,12 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid,
// Removes a deferred download from |deferred_downloads_|.
void CancelDeferredDownload(DeferredDownloadObserver* observer);
+ // DownloadControllerAndroid implementation.
+ bool RequireUserPermissionPrompt(WebContents* web_contents) override;
+ void PromptUserForPermission(
+ WebContents* web_contents,
+ const UserPermissionPromptCallback& callback) override;
+
private:
// Used to store all the information about an Android download.
struct DownloadInfoAndroid {
@@ -81,6 +87,11 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid,
DownloadControllerAndroidImpl();
~DownloadControllerAndroidImpl() override;
+ // Helper method for implementing PromptUserForPermission.
+ void PromptUserForPermissionInternal(
+ WebContents* download_item,
Ted C 2015/07/06 20:03:39 this and the following line are indented 2 too muc
qinmin 2015/07/06 20:36:02 Done.
+ const UserPermissionPromptCallback& callback);
+
// DownloadControllerAndroid implementation.
void CreateGETDownload(int render_process_id,
int render_view_id,
@@ -116,6 +127,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);

Powered by Google App Engine
This is Rietveld 408576698