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

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

Issue 4883003: Add FilePath::FinalExtension() to avoid double extensions (.tar.gz) for file selector (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, work around new Mac problem. Created 7 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_file_picker.cc
diff --git a/chrome/browser/download/download_file_picker.cc b/chrome/browser/download/download_file_picker.cc
index d4820b0d87fda5bbb2790a0f156dead64b19f847..730c396c19f95ddd59e18462b0bc1844c4224687 100644
--- a/chrome/browser/download/download_file_picker.cc
+++ b/chrome/browser/download/download_file_picker.cc
@@ -69,7 +69,9 @@ DownloadFilePicker::DownloadFilePicker(
select_file_dialog_ = ui::SelectFileDialog::Create(
this, new ChromeSelectFilePolicy(web_contents));
ui::SelectFileDialog::FileTypeInfo file_type_info;
- base::FilePath::StringType extension = suggested_path_.Extension();
+ // Platform file pickers, notably on Mac and Windows, tend to break
+ // with double extensions like .tar.gz, so only pass in normal ones.
+ base::FilePath::StringType extension = suggested_path_.FinalExtension();
if (!extension.empty()) {
extension.erase(extension.begin()); // drop the .
file_type_info.extensions.resize(1);

Powered by Google App Engine
This is Rietveld 408576698