| Index: chrome/browser/download/download_util.cc
|
| diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
|
| index c958213eb636ff4648fb92da511303d4478aef29..9fa60b3a5670c44c967146a3825955f565bc56b9 100644
|
| --- a/chrome/browser/download/download_util.cc
|
| +++ b/chrome/browser/download/download_util.cc
|
| @@ -217,20 +217,24 @@ void GenerateFileName(const GURL& url,
|
| const std::string& referrer_charset,
|
| const std::string& mime_type,
|
| FilePath* generated_name) {
|
| -#if defined(OS_WIN)
|
| - FilePath default_file_path(
|
| + string16 default_file_name(
|
| l10n_util::GetStringUTF16(IDS_DEFAULT_DOWNLOAD_FILENAME));
|
| -#elif defined(OS_POSIX)
|
| - std::string default_file =
|
| - l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME);
|
| - FilePath default_file_path(
|
| - base::SysWideToNativeMB(base::SysUTF8ToWide(default_file)));
|
| -#endif
|
|
|
| - *generated_name = net::GetSuggestedFilename(GURL(url),
|
| - content_disposition,
|
| - referrer_charset,
|
| - default_file_path);
|
| + string16 new_name = net::GetSuggestedFilename(GURL(url),
|
| + content_disposition,
|
| + referrer_charset,
|
| + default_file_name);
|
| +
|
| + // TODO(evan): this code is totally wrong -- we should just generate
|
| + // Unicode filenames and do all this encoding switching at the end.
|
| + // However, I'm just shuffling wrong code around, at least not adding
|
| + // to it.
|
| +#if defined(OS_WIN)
|
| + *generated_name = FilePath(new_name);
|
| +#else
|
| + *generated_name = FilePath(
|
| + base::SysWideToNativeMB(UTF16ToWide(new_name)));
|
| +#endif
|
|
|
| DCHECK(!generated_name->empty());
|
|
|
|
|