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

Unified Diff: chrome/browser/ui/views/download/download_danger_prompt_views.cc

Issue 1943993006: Create test fixture for SafeBrowsingService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase update Created 4 years, 7 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
Index: chrome/browser/ui/views/download/download_danger_prompt_views.cc
diff --git a/chrome/browser/ui/views/download/download_danger_prompt_views.cc b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
index 050d591035ada262e89f03b2544727ea9f2496be..0f9b81dc5e8ad94dbd9a5e6a6e95f872efcdaf08 100644
--- a/chrome/browser/ui/views/download/download_danger_prompt_views.cc
+++ b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
@@ -331,10 +331,12 @@ void DownloadDangerPromptViews::RunDone(Action action) {
done_.Reset();
if (download_ != NULL) {
const bool accept = action == DownloadDangerPrompt::ACCEPT;
- RecordDownloadDangerPrompt(accept, *download_);
- if (!download_->GetURL().is_empty() &&
- !download_->GetBrowserContext()->IsOffTheRecord()) {
- SendSafeBrowsingDownloadRecoveryReport(accept, *download_);
+ if (download_->IsDangerous() && !download_->IsDone()) {
+ RecordDownloadDangerPrompt(accept, *download_);
+ if (!download_->GetURL().is_empty() &&
+ !download_->GetBrowserContext()->IsOffTheRecord()) {
+ SendSafeBrowsingDownloadRecoveryReport(accept, *download_);
+ }
}
download_->RemoveObserver(this);
download_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698