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

Unified Diff: chrome/browser/download/download_file_picker.cc

Issue 2453633006: [downloads] Move platform specific code out of DownloadTargetDeterminer. (Closed)
Patch Set: . Created 3 years, 9 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_file_picker.cc
diff --git a/chrome/browser/download/download_file_picker.cc b/chrome/browser/download/download_file_picker.cc
index 07d1ca315d3e2d5660be2e8b58da13d35b996222..aa4675c86559fa337fc5edd9f8d07c5f96f10abb 100644
--- a/chrome/browser/download/download_file_picker.cc
+++ b/chrome/browser/download/download_file_picker.cc
@@ -49,10 +49,9 @@ void RecordFilePickerResult(const base::FilePath& suggested_path,
} // namespace
-DownloadFilePicker::DownloadFilePicker(
- DownloadItem* item,
- const base::FilePath& suggested_path,
- const FileSelectedCallback& callback)
+DownloadFilePicker::DownloadFilePicker(DownloadItem* item,
+ const base::FilePath& suggested_path,
+ const ConfirmationCallback& callback)
: suggested_path_(suggested_path),
file_selected_callback_(callback),
should_record_file_picker_result_(false) {
@@ -104,7 +103,10 @@ DownloadFilePicker::~DownloadFilePicker() {
void DownloadFilePicker::OnFileSelected(const base::FilePath& path) {
if (should_record_file_picker_result_)
RecordFilePickerResult(suggested_path_, path);
- file_selected_callback_.Run(path);
+ file_selected_callback_.Run(path.empty()
+ ? DownloadConfirmationResult::CANCELED
+ : DownloadConfirmationResult::CONFIRMED,
+ path);
delete this;
}
@@ -123,7 +125,7 @@ void DownloadFilePicker::FileSelectionCanceled(void* params) {
// static
void DownloadFilePicker::ShowFilePicker(DownloadItem* item,
const base::FilePath& suggested_path,
- const FileSelectedCallback& callback) {
+ const ConfirmationCallback& callback) {
new DownloadFilePicker(item, suggested_path, callback);
// DownloadFilePicker deletes itself.
}
« no previous file with comments | « chrome/browser/download/download_file_picker.h ('k') | chrome/browser/download/download_path_reservation_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698