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

Unified Diff: chrome/browser/download/save_package_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_file_picker.cc ('k') | ui/shell_dialogs/select_file_dialog_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/save_package_file_picker.cc
diff --git a/chrome/browser/download/save_package_file_picker.cc b/chrome/browser/download/save_package_file_picker.cc
index 40c392833fc0149fe6277699ca1562ed06a7a80f..da18db3b9f31cbf7d79eaad931625a4e889a0a59 100644
--- a/chrome/browser/download/save_package_file_picker.cc
+++ b/chrome/browser/download/save_package_file_picker.cc
@@ -144,11 +144,11 @@ SavePackageFilePicker::SavePackageFilePicker(
// == can_save_as_complete_ on chromeos.
bool add_extra_extension = false;
base::FilePath::StringType extra_extension;
- if (!suggested_path_copy.Extension().empty() &&
+ if (!suggested_path_copy.FinalExtension().empty() &&
!suggested_path_copy.MatchesExtension(FILE_PATH_LITERAL(".htm")) &&
!suggested_path_copy.MatchesExtension(FILE_PATH_LITERAL(".html"))) {
add_extra_extension = true;
- extra_extension = suggested_path_copy.Extension().substr(1);
+ extra_extension = suggested_path_copy.FinalExtension().substr(1);
}
static const size_t kNumberExtensions = arraysize(kIndexToIDS) - 1;
@@ -189,7 +189,8 @@ SavePackageFilePicker::SavePackageFilePicker(
// The contents can not be saved as complete-HTML, so do not show the file
// filters.
file_type_info.extensions.resize(1);
- file_type_info.extensions[0].push_back(suggested_path_copy.Extension());
+ file_type_info.extensions[0].push_back(
+ suggested_path_copy.FinalExtension());
if (!file_type_info.extensions[0][0].empty()) {
// Drop the .
« no previous file with comments | « chrome/browser/download/download_file_picker.cc ('k') | ui/shell_dialogs/select_file_dialog_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698