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

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

Issue 1513413002: Enable "Hide Extension" option when "Save Link As" on the Mac Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits. Created 5 years 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 ac734eab193b124f60fd1ca10db0befa90947cf8..b63b3a2bd176ef392bd9fa71fb186778d5adf30c 100644
--- a/chrome/browser/download/download_file_picker.cc
+++ b/chrome/browser/download/download_file_picker.cc
@@ -12,6 +12,7 @@
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/web_contents.h"
+#include "ui/shell_dialogs/selected_file_info.h"
using content::DownloadItem;
using content::DownloadManager;
@@ -92,22 +93,31 @@ DownloadFilePicker::DownloadFilePicker(
DownloadFilePicker::~DownloadFilePicker() {
}
-void DownloadFilePicker::OnFileSelected(const base::FilePath& path) {
+void DownloadFilePicker::OnFileSelected(const base::FilePath& path,
+ bool hide_file_extension) {
if (should_record_file_picker_result_)
RecordFilePickerResult(suggested_path_, path);
- file_selected_callback_.Run(path);
+ file_selected_callback_.Run(path, hide_file_extension);
delete this;
}
void DownloadFilePicker::FileSelected(const base::FilePath& path,
int index,
void* params) {
- OnFileSelected(path);
+ OnFileSelected(path, false);
// Deletes |this|
}
+void DownloadFilePicker::FileSelectedWithExtraInfo(
+ const ui::SelectedFileInfo& file,
+ int index,
+ void* params) {
+ OnFileSelected(file.local_path.empty() ? file.file_path : file.local_path,
+ file.hide_file_extension);
+}
+
void DownloadFilePicker::FileSelectionCanceled(void* params) {
- OnFileSelected(base::FilePath());
+ OnFileSelected(base::FilePath(), false);
// Deletes |this|
}
« no previous file with comments | « chrome/browser/download/download_file_picker.h ('k') | chrome/browser/download/download_target_determiner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698