Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4533)

Unified Diff: chrome/browser/ui/webui/downloads_dom_handler.cc

Issue 10912183: Remove DownloadManager::GetDownloadItem in favor of GetDownload() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugins/plugin_installer.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/downloads_dom_handler.cc
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index 44d1afd8d32b884e078a61140f43e49201ae0673..d2528f1f37f945fb56dd4457daf1e2ed94179f82 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -475,9 +475,9 @@ void DownloadsDOMHandler::DangerPromptAccepted(int download_id) {
content::DownloadItem* item = NULL;
if (main_notifier_.GetManager())
item = main_notifier_.GetManager()->GetDownload(download_id);
- if (original_notifier_.get() && original_notifier_->GetManager())
+ if (!item && original_notifier_.get() && original_notifier_->GetManager())
item = original_notifier_->GetManager()->GetDownload(download_id);
- if (!item)
+ if (!item || (item->GetState() != content::DownloadItem::IN_PROGRESS))
return;
CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS);
item->DangerousDownloadValidated();
@@ -491,7 +491,7 @@ content::DownloadItem* DownloadsDOMHandler::GetDownloadByValue(
content::DownloadItem* item = NULL;
if (main_notifier_.GetManager())
item = main_notifier_.GetManager()->GetDownload(download_id);
- if (original_notifier_.get() && original_notifier_->GetManager())
+ if (!item && original_notifier_.get() && original_notifier_->GetManager())
item = original_notifier_->GetManager()->GetDownload(download_id);
return item;
}
« no previous file with comments | « chrome/browser/plugins/plugin_installer.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698