Chromium Code Reviews| Index: chrome/browser/download/download_manager.cc |
| diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc |
| index 014f01c9471b7159edbce3ba4ed7a6a62f03f3d0..dce35f2b9f079f4c47bd3c0eb2a635629fc5ecd0 100644 |
| --- a/chrome/browser/download/download_manager.cc |
| +++ b/chrome/browser/download/download_manager.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -334,10 +334,19 @@ void DownloadManager::CheckIfSuggestedPathExists(DownloadCreateInfo* info, |
| // download. |
| FilePath::StringType file_name; |
| FilePath path; |
| +#if defined(OS_WIN) |
| + std::wstring unconfirmed_prefix = UTF16ToWideHack( |
|
brettw
2011/01/20 18:49:22
You can just use a string16 here and skip the UTF1
tfarina
2011/01/20 18:55:31
Ah, yeah. I've used string16 on patchset 2, but wi
|
| + l10n_util::GetStringUTF16(IDS_DOWNLOAD_UNCONFIRMED_PREFIX)); |
| +#else |
| + std::string unconfirmed_prefix = |
| + l10n_util::GetStringUTF8(IDS_DOWNLOAD_UNCONFIRMED_PREFIX); |
| +#endif |
| + |
| while (path.empty()) { |
| base::SStringPrintf( |
| &file_name, |
| - FILE_PATH_LITERAL("unconfirmed %d.crdownload"), |
| + unconfirmed_prefix.append( |
| + FILE_PATH_LITERAL(" %d.crdownload")).c_str(), |
|
Randy Smith (Not in Mondays)
2011/01/20 16:41:14
I don't know enough about UTF-8/16 string/wstring
brettw
2011/01/20 18:49:22
This looks like it would work to me. I tried to co
|
| base::RandInt(0, 100000)); |
| path = dir.Append(file_name); |
| if (file_util::PathExists(path)) |