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 11 matching lines...) Expand all Loading... |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/browser/download_manager.h" | 23 #include "content/public/browser/download_manager.h" |
24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
25 #include "content/public/browser/web_contents_view.h" | 25 #include "content/public/browser/web_contents_view.h" |
26 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 ShellDownloadManagerDelegate::ShellDownloadManagerDelegate() | 30 ShellDownloadManagerDelegate::ShellDownloadManagerDelegate() |
31 : download_manager_(NULL), | 31 : download_manager_(NULL), |
32 suppress_prompting_(false), | 32 suppress_prompting_(false) { |
33 last_download_db_handle_(DownloadItem::kUninitializedHandle) { | |
34 // Balanced in Shutdown(); | 33 // Balanced in Shutdown(); |
35 AddRef(); | 34 AddRef(); |
36 } | 35 } |
37 | 36 |
38 ShellDownloadManagerDelegate::~ShellDownloadManagerDelegate(){ | 37 ShellDownloadManagerDelegate::~ShellDownloadManagerDelegate(){ |
39 } | 38 } |
40 | 39 |
41 | 40 |
42 void ShellDownloadManagerDelegate::SetDownloadManager( | 41 void ShellDownloadManagerDelegate::SetDownloadManager( |
43 DownloadManager* download_manager) { | 42 DownloadManager* download_manager) { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 173 } |
175 gtk_widget_destroy(dialog); | 174 gtk_widget_destroy(dialog); |
176 #else | 175 #else |
177 NOTIMPLEMENTED(); | 176 NOTIMPLEMENTED(); |
178 #endif | 177 #endif |
179 | 178 |
180 callback.Run(result, DownloadItem::TARGET_DISPOSITION_PROMPT, | 179 callback.Run(result, DownloadItem::TARGET_DISPOSITION_PROMPT, |
181 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result); | 180 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result); |
182 } | 181 } |
183 | 182 |
184 void ShellDownloadManagerDelegate::AddItemToPersistentStore( | |
185 DownloadItem* item) { | |
186 download_manager_->OnItemAddedToPersistentStore( | |
187 item->GetId(), --last_download_db_handle_); | |
188 } | |
189 | |
190 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( | 183 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( |
191 const FilePath& default_download_path) { | 184 const FilePath& default_download_path) { |
192 default_download_path_ = default_download_path; | 185 default_download_path_ = default_download_path; |
193 suppress_prompting_ = true; | 186 suppress_prompting_ = true; |
194 } | 187 } |
195 | 188 |
196 } // namespace content | 189 } // namespace content |
OLD | NEW |