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

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: Comment (also a rebase) Created 7 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
« no previous file with comments | « chrome/browser/download/download_extensions.cc ('k') | chrome/browser/download/save_package_file_picker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 94dc46297da1b10c5389e3c8abecd054d21d2cd2..a2d2d3e29e06ca730af29579590a1dda8bd9d2bb 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);
« no previous file with comments | « chrome/browser/download/download_extensions.cc ('k') | chrome/browser/download/save_package_file_picker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698