Chromium Code Reviews| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 } | 104 } |
| 105 | 105 |
| 106 void ShellDownloadManagerDelegate::OnDownloadPathGenerated( | 106 void ShellDownloadManagerDelegate::OnDownloadPathGenerated( |
| 107 int32 download_id, | 107 int32 download_id, |
| 108 const DownloadTargetCallback& callback, | 108 const DownloadTargetCallback& callback, |
| 109 const FilePath& suggested_path) { | 109 const FilePath& suggested_path) { |
| 110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 111 if (suppress_prompting_) { | 111 if (suppress_prompting_) { |
| 112 // Testing exit. | 112 // Testing exit. |
| 113 callback.Run(suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, | 113 callback.Run(suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, |
| 114 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, suggested_path); | 114 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, |
| 115 suggested_path.AddExtension(FILE_PATH_LITERAL(".crdownload"))); | |
|
benjhayden
2012/09/12 21:01:01
Why do this in this CL?
Randy Smith (Not in Mondays)
2012/09/13 20:15:12
As it turns out, without this change, we don't *ha
| |
| 115 return; | 116 return; |
| 116 } | 117 } |
| 117 | 118 |
| 118 ChooseDownloadPath(download_id, callback, suggested_path); | 119 ChooseDownloadPath(download_id, callback, suggested_path); |
| 119 } | 120 } |
| 120 | 121 |
| 121 void ShellDownloadManagerDelegate::ChooseDownloadPath( | 122 void ShellDownloadManagerDelegate::ChooseDownloadPath( |
| 122 int32 download_id, | 123 int32 download_id, |
| 123 const DownloadTargetCallback& callback, | 124 const DownloadTargetCallback& callback, |
| 124 const FilePath& suggested_path) { | 125 const FilePath& suggested_path) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 item->GetId(), --last_download_db_handle_); | 188 item->GetId(), --last_download_db_handle_); |
| 188 } | 189 } |
| 189 | 190 |
| 190 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( | 191 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( |
| 191 const FilePath& default_download_path) { | 192 const FilePath& default_download_path) { |
| 192 default_download_path_ = default_download_path; | 193 default_download_path_ = default_download_path; |
| 193 suppress_prompting_ = true; | 194 suppress_prompting_ = true; |
| 194 } | 195 } |
| 195 | 196 |
| 196 } // namespace content | 197 } // namespace content |
| OLD | NEW |