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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 return true; | 99 return true; |
100 } | 100 } |
101 | 101 |
102 void ShellDownloadManagerDelegate::GenerateFilename( | 102 void ShellDownloadManagerDelegate::GenerateFilename( |
103 int32 download_id, | 103 int32 download_id, |
104 const DownloadTargetCallback& callback, | 104 const DownloadTargetCallback& callback, |
105 const base::FilePath& generated_name, | 105 const base::FilePath& generated_name, |
106 const base::FilePath& suggested_directory) { | 106 const base::FilePath& suggested_directory) { |
107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
108 if (!file_util::PathExists(suggested_directory)) | 108 if (!base::PathExists(suggested_directory)) |
109 file_util::CreateDirectory(suggested_directory); | 109 file_util::CreateDirectory(suggested_directory); |
110 | 110 |
111 base::FilePath suggested_path(suggested_directory.Append(generated_name)); | 111 base::FilePath suggested_path(suggested_directory.Append(generated_name)); |
112 BrowserThread::PostTask( | 112 BrowserThread::PostTask( |
113 BrowserThread::UI, | 113 BrowserThread::UI, |
114 FROM_HERE, | 114 FROM_HERE, |
115 base::Bind( | 115 base::Bind( |
116 &ShellDownloadManagerDelegate::OnDownloadPathGenerated, | 116 &ShellDownloadManagerDelegate::OnDownloadPathGenerated, |
117 this, download_id, callback, suggested_path)); | 117 this, download_id, callback, suggested_path)); |
118 } | 118 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result); | 196 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result); |
197 } | 197 } |
198 | 198 |
199 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( | 199 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( |
200 const base::FilePath& default_download_path) { | 200 const base::FilePath& default_download_path) { |
201 default_download_path_ = default_download_path; | 201 default_download_path_ = default_download_path; |
202 suppress_prompting_ = true; | 202 suppress_prompting_ = true; |
203 } | 203 } |
204 | 204 |
205 } // namespace content | 205 } // namespace content |
OLD | NEW |