| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 DownloadItem* download = | 45 DownloadItem* download = |
| 46 download_manager_->GetActiveDownloadItem(download_id); | 46 download_manager_->GetActiveDownloadItem(download_id); |
| 47 DownloadStateInfo state = download->GetStateInfo(); | 47 DownloadStateInfo state = download->GetStateInfo(); |
| 48 | 48 |
| 49 if (!state.force_file_name.empty()) | 49 if (!state.force_file_name.empty()) |
| 50 return true; | 50 return true; |
| 51 | 51 |
| 52 FilePath generated_name = net::GenerateFileName( | 52 FilePath generated_name = net::GenerateFileName( |
| 53 download->GetURL(), | 53 download->GetURL(), |
| 54 download->GetContentDisposition(), | 54 download->GetContentDisposition(), |
| 55 download->GetReferrerCharset(), | 55 download->GetDefaultCharset(), |
| 56 download->GetSuggestedFilename(), | 56 download->GetSuggestedFilename(), |
| 57 download->GetMimeType(), | 57 download->GetMimeType(), |
| 58 "download"); | 58 "download"); |
| 59 | 59 |
| 60 // Since we have no download UI, show the user a dialog always. | 60 // Since we have no download UI, show the user a dialog always. |
| 61 state.prompt_user_for_save_location = true; | 61 state.prompt_user_for_save_location = true; |
| 62 | 62 |
| 63 BrowserThread::PostTask( | 63 BrowserThread::PostTask( |
| 64 BrowserThread::FILE, | 64 BrowserThread::FILE, |
| 65 FROM_HERE, | 65 FROM_HERE, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 #endif | 132 #endif |
| 133 | 133 |
| 134 if (result.empty()) { | 134 if (result.empty()) { |
| 135 download_manager_->FileSelectionCanceled(data); | 135 download_manager_->FileSelectionCanceled(data); |
| 136 } else { | 136 } else { |
| 137 download_manager_->FileSelected(result, data); | 137 download_manager_->FileSelected(result, data); |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace content | 141 } // namespace content |
| OLD | NEW |