| OLD | NEW |
| 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 #include "content/shell/shell_download_manager_delegate.h" | 5 #include "content/shell/shell_download_manager_delegate.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <commdlg.h> | 9 #include <commdlg.h> |
| 10 #endif | 10 #endif |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return; | 98 return; |
| 99 download->SetFileCheckResults(state); | 99 download->SetFileCheckResults(state); |
| 100 download_manager_->RestartDownload(download_id); | 100 download_manager_->RestartDownload(download_id); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void ShellDownloadManagerDelegate::ChooseDownloadPath( | 103 void ShellDownloadManagerDelegate::ChooseDownloadPath( |
| 104 WebContents* web_contents, | 104 WebContents* web_contents, |
| 105 const FilePath& suggested_path, | 105 const FilePath& suggested_path, |
| 106 int32 download_id) { | 106 int32 download_id) { |
| 107 FilePath result; | 107 FilePath result; |
| 108 #if defined(OS_WIN) | 108 #if defined(OS_WIN) && !defined(USE_AURA) |
| 109 std::wstring file_part = FilePath(suggested_path).BaseName().value(); | 109 std::wstring file_part = FilePath(suggested_path).BaseName().value(); |
| 110 wchar_t file_name[MAX_PATH]; | 110 wchar_t file_name[MAX_PATH]; |
| 111 base::wcslcpy(file_name, file_part.c_str(), arraysize(file_name)); | 111 base::wcslcpy(file_name, file_part.c_str(), arraysize(file_name)); |
| 112 OPENFILENAME save_as; | 112 OPENFILENAME save_as; |
| 113 ZeroMemory(&save_as, sizeof(save_as)); | 113 ZeroMemory(&save_as, sizeof(save_as)); |
| 114 save_as.lStructSize = sizeof(OPENFILENAME); | 114 save_as.lStructSize = sizeof(OPENFILENAME); |
| 115 save_as.hwndOwner = web_contents->GetNativeView(); | 115 save_as.hwndOwner = web_contents->GetNativeView(); |
| 116 save_as.lpstrFile = file_name; | 116 save_as.lpstrFile = file_name; |
| 117 save_as.nMaxFile = arraysize(file_name); | 117 save_as.nMaxFile = arraysize(file_name); |
| 118 | 118 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 if (result.empty()) { | 133 if (result.empty()) { |
| 134 download_manager_->FileSelectionCanceled(download_id); | 134 download_manager_->FileSelectionCanceled(download_id); |
| 135 } else { | 135 } else { |
| 136 download_manager_->FileSelected(result, download_id); | 136 download_manager_->FileSelected(result, download_id); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace content | 140 } // namespace content |
| OLD | NEW |