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

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

Issue 11092088: Cleanup referrer_charset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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
« no previous file with comments | « no previous file | chrome/browser/net/chrome_url_request_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 56e7ced757e0b9516af9fe89a096ff4bf21348f5..e9e5c4e06aa9ebc47522d2f462d618ba879213fa 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -113,13 +113,14 @@ SafeBrowsingState::~SafeBrowsingState() {}
// in operation to net::GenerateFileName(), but uses a localized
// default name.
void GenerateFileNameFromRequest(const DownloadItem& download_item,
- FilePath* generated_name) {
+ FilePath* generated_name,
+ std::string referrer_charset) {
std::string default_file_name(
l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
*generated_name = net::GenerateFileName(download_item.GetURL(),
download_item.GetContentDisposition(),
- download_item.GetReferrerCharset(),
+ referrer_charset,
download_item.GetSuggestedFilename(),
download_item.GetMimeType(),
default_file_name);
@@ -718,7 +719,10 @@ void ChromeDownloadManagerDelegate::CheckVisitedReferrerBeforeDone(
// Allow extensions to be explicitly saved.
if (!is_forced_path) {
FilePath generated_name;
- GenerateFileNameFromRequest(*download, &generated_name);
+ GenerateFileNameFromRequest(
+ *download,
+ &generated_name,
+ profile_->GetPrefs()->GetString(prefs::kDefaultCharset));
// Freeze the user's preference for showing a Save As dialog. We're going
// to bounce around a bunch of threads and we don't want to worry about race
« no previous file with comments | « no previous file | chrome/browser/net/chrome_url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698