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

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

Issue 2150903002: Reland add hooks to permission layer for permission action reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits Created 4 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
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.h ('k') | chrome/browser/ui/website_settings/website_settings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/ui_manager.cc
diff --git a/chrome/browser/safe_browsing/ui_manager.cc b/chrome/browser/safe_browsing/ui_manager.cc
index 8543c38bf4b68885feba7e02f3c7578c3029bb89..ab4769e7a7ac95a4c70ff1efb2802faf3f31af3c 100644
--- a/chrome/browser/safe_browsing/ui_manager.cc
+++ b/chrome/browser/safe_browsing/ui_manager.cc
@@ -280,6 +280,17 @@ void SafeBrowsingUIManager::ReportInvalidCertificateChain(
callback);
}
+void SafeBrowsingUIManager::ReportPermissionAction(
+ const GURL& origin,
+ content::PermissionType permission,
+ PermissionAction action) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&SafeBrowsingUIManager::ReportPermissionActionOnIOThread, this,
+ origin, permission, action));
+}
+
void SafeBrowsingUIManager::AddObserver(Observer* observer) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
observer_list_.AddObserver(observer);
@@ -302,6 +313,21 @@ void SafeBrowsingUIManager::ReportInvalidCertificateChainOnIOThread(
sb_service_->ping_manager()->ReportInvalidCertificateChain(serialized_report);
}
+void SafeBrowsingUIManager::ReportPermissionActionOnIOThread(
+ const GURL& origin,
+ content::PermissionType permission,
+ PermissionAction action) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+ // The service may delete the ping manager (i.e. when user disabling service,
+ // etc). This happens on the IO thread.
+ if (!sb_service_ || !sb_service_->ping_manager())
+ return;
+
+ sb_service_->ping_manager()->ReportPermissionAction(origin, permission,
+ action);
+}
+
// If the user had opted-in to send ThreatDetails, this gets called
// when the report is ready.
void SafeBrowsingUIManager::SendSerializedThreatDetails(
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.h ('k') | chrome/browser/ui/website_settings/website_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698