Chromium Code Reviews| 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 80a38d0338e21359b4a371dad026f875f94799dc..48e6583d48a7fbaa09058a98b7e9c6231bec6d4e 100644 |
| --- a/chrome/browser/safe_browsing/ui_manager.cc |
| +++ b/chrome/browser/safe_browsing/ui_manager.cc |
| @@ -281,6 +281,17 @@ void SafeBrowsingUIManager::ReportInvalidCertificateChain( |
| callback); |
| } |
| +void SafeBrowsingUIManager::ReportPermissionAction( |
| + const GURL& origin, |
| + content::PermissionType permission, |
| + PermissionAction action) { |
| + DCHECK_CURRENTLY_ON(BrowserThread::UI); |
|
Nathan Parker
2016/06/16 21:08:41
nit: I'm not clear on why this _has_ to be on the
stefanocs
2016/06/17 00:42:08
I'm also not clear about this but the other two re
|
| + 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); |
| @@ -303,6 +314,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( |