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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 7408001: If we show a SafeBrowsing warning we always send the client-side detection (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge Created 9 years, 5 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/safe_browsing/safe_browsing_service.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index 88710ef142602620e0f2967bf6b20528390f3ac0..cac584c5a29534107b6cd36011a7a0750ba3c38f 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -1035,7 +1035,9 @@ void SafeBrowsingService::DoDisplayBlockingPage(
resource.is_subresource, resource.threat_type,
std::string() /* post_data */);
}
-
+ if (resource.threat_type != SafeBrowsingService::SAFE) {
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnSafeBrowsingHit(resource));
+ }
SafeBrowsingBlockingPage::ShowBlockingPage(this, resource);
}
@@ -1065,6 +1067,16 @@ void SafeBrowsingService::ReportSafeBrowsingHit(
post_data));
}
+void SafeBrowsingService::AddObserver(Observer* observer) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ observer_list_.AddObserver(observer);
+}
+
+void SafeBrowsingService::RemoveObserver(Observer* observer) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ observer_list_.RemoveObserver(observer);
+}
+
void SafeBrowsingService::ReportSafeBrowsingHitOnIOThread(
const GURL& malicious_url,
const GURL& page_url,

Powered by Google App Engine
This is Rietveld 408576698