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

Unified Diff: content/public/test/download_test_observer.cc

Issue 1784433003: Track CTR of uncommon download warning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 9 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: content/public/test/download_test_observer.cc
diff --git a/content/public/test/download_test_observer.cc b/content/public/test/download_test_observer.cc
index 9d05e2885d4c856c9a83a381b4d55b6ad52d560c..b5746f0c4b2d84361cde8c2d27b443056c74f40e 100644
--- a/content/public/test/download_test_observer.cc
+++ b/content/public/test/download_test_observer.cc
@@ -199,6 +199,19 @@ size_t DownloadTestObserver::NumDownloadsSeenInState(
return it->second;
}
+DownloadManager* DownloadTestObserver::download_manager() {
+ return download_manager_;
+}
+
+DownloadTestObserver::DangerousDownloadAction
+DownloadTestObserver::dangerous_download_action() {
+ return dangerous_download_action_;
+}
+
+std::set<uint32_t>& DownloadTestObserver::dangerous_downloads_seen() {
+ return dangerous_downloads_seen_;
+}
+
void DownloadTestObserver::DownloadInFinalState(DownloadItem* download) {
if (finished_downloads_.find(download) != finished_downloads_.end()) {
// We've already seen the final state on this download.
@@ -225,7 +238,7 @@ void DownloadTestObserver::AcceptDangerousDownload(uint32_t download_id) {
if (!download_manager_)
return;
DownloadItem* download = download_manager_->GetDownload(download_id);
- if (download && !download->IsDone())
+ if (download && download->IsDangerous() && !download->IsDone())
download->ValidateDangerousDownload();
}

Powered by Google App Engine
This is Rietveld 408576698