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

Unified Diff: chrome/browser/views/shell_dialogs_win.cc

Issue 3069018: Win: Don't give some downloads duplicate extensions like .arj.arj... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/views/shell_dialogs_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/shell_dialogs_win.cc
===================================================================
--- chrome/browser/views/shell_dialogs_win.cc (revision 54609)
+++ chrome/browser/views/shell_dialogs_win.cc (working copy)
@@ -41,11 +41,14 @@
DCHECK(!filename.empty());
std::wstring return_value = filename;
- // If the user didn't give us a known extension, and we wanted one, add it.
+ // If we wanted a specific extension, but the user's filename deleted it or
+ // changed it to something that the system doesn't understand, re-append.
std::string selected_mime_type;
+ std::wstring file_extension = file_util::GetFileExtensionFromPath(filename);
if (!(filter_selected.empty() || filter_selected == L"*.*") &&
!net::GetMimeTypeFromExtension(
- file_util::GetFileExtensionFromPath(filename), &selected_mime_type)) {
+ file_extension, &selected_mime_type) &&
+ file_extension != suggested_ext) {
if (return_value[return_value.length() - 1] != L'.')
return_value.append(L".");
return_value.append(suggested_ext);
« no previous file with comments | « no previous file | chrome/browser/views/shell_dialogs_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698