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

Unified Diff: chrome/browser/download/download_target_determiner.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
Index: chrome/browser/download/download_target_determiner.h
diff --git a/chrome/browser/download/download_target_determiner.h b/chrome/browser/download/download_target_determiner.h
index 0bb4cb034e297f6e0540ce9aee9d75502a64efe0..46f17a778141fef5b825339ec48db7da1e1c61e5 100644
--- a/chrome/browser/download/download_target_determiner.h
+++ b/chrome/browser/download/download_target_determiner.h
@@ -93,6 +93,7 @@ class DownloadTargetDeterminer
// Result indicating how the workflow should proceed. The loop ends when a
// handler returns COMPLETE.
enum State {
+ STATE_PROMPT_USER_FOR_PERMISSION,
STATE_GENERATE_TARGET_PATH,
STATE_NOTIFY_EXTENSIONS,
STATE_RESERVE_VIRTUAL_PATH,
@@ -148,6 +149,17 @@ class DownloadTargetDeterminer
// === Main workflow ===
+ // Prompts user for file access if necessary.
+ // Next state:
+ // - STATE_GENERATE_TARGET_PATH.
+ Result DoPromptUserForPermission();
+
+#if defined(OS_ANDROID)
+ // Callback invoked after the file access prompt completes. Cancels the
+ // download if the user doesn't grant file access.
+ void PromptUserForPermissionDone(bool granted);
+#endif
+
// Generates an initial target path. This target is based only on the state of
// the download item.
// Next state:

Powered by Google App Engine
This is Rietveld 408576698