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

Unified Diff: chrome/browser/download/download_target_determiner_delegate.h

Issue 2453633006: [downloads] Move platform specific code out of DownloadTargetDeterminer. (Closed)
Patch Set: . Created 4 years, 2 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_delegate.h
diff --git a/chrome/browser/download/download_target_determiner_delegate.h b/chrome/browser/download/download_target_determiner_delegate.h
index f2aeec6f03625bf71cb9a3a1461f2bd68d700f88..9cf1ab29c76411e29b53dc5b04cf1199675a1ac5 100644
--- a/chrome/browser/download/download_target_determiner_delegate.h
+++ b/chrome/browser/download/download_target_determiner_delegate.h
@@ -5,8 +5,11 @@
#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_DELEGATE_H_
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_DELEGATE_H_
-#include "base/callback_forward.h"
+#include <string>
+#include "base/callback_forward.h"
+#include "chrome/browser/download/download_confirmation_reason.h"
+#include "chrome/browser/download/download_confirmation_result.h"
#include "chrome/browser/download/download_path_reservation_tracker.h"
#include "content/public/browser/download_danger_type.h"
@@ -35,20 +38,19 @@ class DownloadTargetDeterminerDelegate {
DownloadPathReservationTracker::FilenameConflictAction conflict_action)>
NotifyExtensionsCallback;
- // Callback to be invoked when ReserveVirtualPath() completes. If the path
- // reservation is successful, then |successful| should be true and
- // |reserved_path| should contain the reserved path. Otherwise, |successful|
- // should be false. In the failure case, |reserved_path| is ignored.
+ // Callback to be invoked when ReserveVirtualPath() completes.
typedef base::Callback<void(const base::FilePath& reserved_path,
svaldez 2016/10/28 17:29:36 Might want to align ReservedPath... and FileSelect
asanka 2016/11/07 19:50:15 Done.
- bool successful)> ReservedPathCallback;
+ DownloadTargetResult)>
+ ReservedPathCallback;
- // Callback to be invoked when PromptUserForDownloadPath() completes.
+ // Callback to be invoked when RequestConfirmation() completes.
// |virtual_path|: The path chosen by the user. If the user cancels the file
// selection, then this parameter will be the empty path. On Chrome OS,
// this path may contain virtual mount points if the user chose a virtual
// path (e.g. Google Drive).
- typedef base::Callback<void(const base::FilePath& virtual_path)>
- FileSelectedCallback;
+ typedef base::Callback<void(DownloadConfirmationResult,
+ const base::FilePath& virtual_path)>
+ FileSelectedCallback;
// Callback to be invoked when DetermineLocalPath() completes. The argument
// should be the determined local path. It should be non-empty on success. If
@@ -96,10 +98,10 @@ class DownloadTargetDeterminerDelegate {
// Display a prompt to the user requesting that a download target be chosen.
// Should invoke |callback| upon completion.
- virtual void PromptUserForDownloadPath(
- content::DownloadItem* download,
- const base::FilePath& virtual_path,
- const FileSelectedCallback& callback) = 0;
+ virtual void RequestConfirmation(content::DownloadItem* download,
+ const base::FilePath& virtual_path,
+ DownloadConfirmationReason reason,
+ const FileSelectedCallback& callback) = 0;
// If |virtual_path| is not a local path, should return a possibly temporary
// local path to use for storing the downloaded file. If |virtual_path| is
@@ -118,6 +120,7 @@ class DownloadTargetDeterminerDelegate {
// Get the MIME type for the given file.
virtual void GetFileMimeType(const base::FilePath& path,
const GetFileMimeTypeCallback& callback) = 0;
+
protected:
virtual ~DownloadTargetDeterminerDelegate();
};

Powered by Google App Engine
This is Rietveld 408576698