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

Unified Diff: chrome/common/win_util.cc

Issue 18699: Fix a bug when saving web pages that have a period in their title (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 | « chrome/common/win_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/win_util.cc
===================================================================
--- chrome/common/win_util.cc (revision 8505)
+++ chrome/common/win_util.cc (working copy)
@@ -387,6 +387,7 @@
suggested_name,
filter,
L"",
+ false,
&index,
final_name);
}
@@ -395,6 +396,7 @@
const std::wstring& suggested_name,
const std::wstring& filter,
const std::wstring& def_ext,
+ bool ignore_suggested_ext,
unsigned* index,
std::wstring* final_name) {
DCHECK(final_name);
@@ -472,9 +474,12 @@
filter_selected = filters[(2 * (save_as.nFilterIndex - 1)) + 1];
// Get the extension that was suggested to the user (when the Save As dialog
- // was opened).
- std::wstring suggested_ext =
- file_util::GetFileExtensionFromPath(suggested_name);
+ // was opened). For saving web pages, we skip this step since there may be
+ // 'extension characters' in the title of the web page.
+ std::wstring suggested_ext;
+ if (!ignore_suggested_ext)
+ suggested_ext = file_util::GetFileExtensionFromPath(suggested_name);
+
// If we can't get the extension from the suggested_name, we use the default
// extension passed in. This is to cover cases like when saving a web page,
// where we get passed in a name without an extension and a default extension
« no previous file with comments | « chrome/common/win_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698