| 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(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 callback.Run(download->GetForcedFilePath(), | 63 callback.Run(download->GetForcedFilePath(), |
| 64 DownloadItem::TARGET_DISPOSITION_OVERWRITE, | 64 DownloadItem::TARGET_DISPOSITION_OVERWRITE, |
| 65 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, | 65 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, |
| 66 download->GetForcedFilePath()); | 66 download->GetForcedFilePath()); |
| 67 return true; | 67 return true; |
| 68 } | 68 } |
| 69 | 69 |
| 70 FilePath generated_name = net::GenerateFileName( | 70 FilePath generated_name = net::GenerateFileName( |
| 71 download->GetURL(), | 71 download->GetURL(), |
| 72 download->GetContentDisposition(), | 72 download->GetContentDisposition(), |
| 73 download->GetReferrerCharset(), | 73 EmptyString(), |
| 74 download->GetSuggestedFilename(), | 74 download->GetSuggestedFilename(), |
| 75 download->GetMimeType(), | 75 download->GetMimeType(), |
| 76 "download"); | 76 "download"); |
| 77 | 77 |
| 78 BrowserThread::PostTask( | 78 BrowserThread::PostTask( |
| 79 BrowserThread::FILE, | 79 BrowserThread::FILE, |
| 80 FROM_HERE, | 80 FROM_HERE, |
| 81 base::Bind( | 81 base::Bind( |
| 82 &ShellDownloadManagerDelegate::GenerateFilename, | 82 &ShellDownloadManagerDelegate::GenerateFilename, |
| 83 this, download->GetId(), callback, generated_name, | 83 this, download->GetId(), callback, generated_name, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 item->GetId(), --last_download_db_handle_); | 187 item->GetId(), --last_download_db_handle_); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( | 190 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( |
| 191 const FilePath& default_download_path) { | 191 const FilePath& default_download_path) { |
| 192 default_download_path_ = default_download_path; | 192 default_download_path_ = default_download_path; |
| 193 suppress_prompting_ = true; | 193 suppress_prompting_ = true; |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace content | 196 } // namespace content |
| OLD | NEW |