Index: chrome/browser/views/tab_contents/tab_contents_view_win.cc |
=================================================================== |
--- chrome/browser/views/tab_contents/tab_contents_view_win.cc (revision 29772) |
+++ chrome/browser/views/tab_contents/tab_contents_view_win.cc (working copy) |
@@ -138,10 +138,12 @@ |
file_name = file_name.BaseName().RemoveExtension(); |
if (file_name.value().empty()) { |
// Retrieve the name from the URL. |
- std::wstring fn = net::GetSuggestedFilename(drop_data.url, "", "", L""); |
- if ((fn.size() + drop_data.file_extension.size() + 1) > MAX_PATH) |
- fn = fn.substr(0, MAX_PATH - drop_data.file_extension.size() - 2); |
- file_name = FilePath::FromWStringHack(fn); |
+ file_name = net::GetSuggestedFilename(drop_data.url, "", "", ""); |
+ if (file_name.value().size() + drop_data.file_extension.size() + 1 > |
+ MAX_PATH) { |
+ file_name = FilePath(file_name.value().substr( |
+ 0, MAX_PATH - drop_data.file_extension.size() - 2)); |
+ } |
} |
file_name = file_name.ReplaceExtension(drop_data.file_extension); |
data.SetFileContents(file_name.value(), drop_data.file_contents); |