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

Side by Side Diff: chrome/browser/download/download_util.cc

Issue 9317018: referrer_charset is a lie. It's really the user's default_charset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/net/chrome_url_request_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Download utility implementation 5 // Download utility implementation
6 6
7 #include "chrome/browser/download/download_util.h" 7 #include "chrome/browser/download/download_util.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <shobjidl.h> 10 #include <shobjidl.h>
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 return (download_path == desktop_dir); 151 return (download_path == desktop_dir);
152 } 152 }
153 153
154 void GenerateFileNameFromRequest(const DownloadItem& download_item, 154 void GenerateFileNameFromRequest(const DownloadItem& download_item,
155 FilePath* generated_name) { 155 FilePath* generated_name) {
156 std::string default_file_name( 156 std::string default_file_name(
157 l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); 157 l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
158 158
159 *generated_name = net::GenerateFileName(download_item.GetURL(), 159 *generated_name = net::GenerateFileName(download_item.GetURL(),
160 download_item.GetContentDisposition(), 160 download_item.GetContentDisposition(),
161 download_item.GetReferrerCharset(), 161 download_item.GetDefaultCharset(),
162 download_item.GetSuggestedFilename(), 162 download_item.GetSuggestedFilename(),
163 download_item.GetMimeType(), 163 download_item.GetMimeType(),
164 default_file_name); 164 default_file_name);
165 } 165 }
166 166
167 // Download progress painting -------------------------------------------------- 167 // Download progress painting --------------------------------------------------
168 168
169 // Common bitmaps used for download progress animations. We load them once the 169 // Common bitmaps used for download progress animations. We load them once the
170 // first time we do a progress paint, then reuse them as they are always the 170 // first time we do a progress paint, then reuse them as they are always the
171 // same. 171 // same.
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 kMaxShelfSize); 629 kMaxShelfSize);
630 } 630 }
631 } 631 }
632 632
633 void RecordDownloadCount(ChromeDownloadCountTypes type) { 633 void RecordDownloadCount(ChromeDownloadCountTypes type) {
634 UMA_HISTOGRAM_ENUMERATION( 634 UMA_HISTOGRAM_ENUMERATION(
635 "Download.CountsChrome", type, DOWNLOAD_COUNT_TYPES_LAST_ENTRY); 635 "Download.CountsChrome", type, DOWNLOAD_COUNT_TYPES_LAST_ENTRY);
636 } 636 }
637 637
638 } // namespace download_util 638 } // namespace download_util
OLDNEW
« 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