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

Unified Diff: chrome/browser/permissions/permission_context_base.h

Issue 2555913002: Implement origin specific Permissions Blacklisting. (Closed)
Patch Set: Address review comments. Created 4 years 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/permissions/permission_context_base.h
diff --git a/chrome/browser/permissions/permission_context_base.h b/chrome/browser/permissions/permission_context_base.h
index f556165e1334adbf2f4f866fe7c3528a137b98cc..38e4779c5d61042c52c3bacc3247ab51c62986b6 100644
--- a/chrome/browser/permissions/permission_context_base.h
+++ b/chrome/browser/permissions/permission_context_base.h
@@ -15,6 +15,7 @@
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/keyed_service/core/keyed_service.h"
+#include "components/safe_browsing_db/database_manager.h"
#include "content/public/browser/permission_type.h"
#if defined(OS_ANDROID)
@@ -80,6 +81,18 @@ class PermissionContextBase : public KeyedService {
bool user_gesture,
const BrowserPermissionCallback& callback);
+ // Called when the requesting origin and permission have been checked by Safe
+ // Browsing The result determines whether to auto-block the permission request
dominickn 2016/12/08 00:04:03 Nit: full stop.
meredithl 2016/12/08 01:25:29 Done.
+ // without prompting the user for a decision.
+ void CheckPermissionsBlacklistResult(
+ content::WebContents* web_contents,
+ const PermissionRequestID& id,
+ const GURL& requesting_origin,
+ const GURL& embedding_origin,
+ bool user_gesture,
+ const BrowserPermissionCallback& callback,
+ bool permission_blocked);
+
// Returns whether the permission has been granted, denied...
virtual ContentSetting GetPermissionStatus(
const GURL& requesting_origin,
@@ -155,6 +168,10 @@ class PermissionContextBase : public KeyedService {
return content_settings_type_;
}
+ // Virtual to allow for mocking in tests.
+ virtual scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>
+ GetSafeBrowsingDatabaseManager();
+
private:
friend class PermissionContextBaseTests;

Powered by Google App Engine
This is Rietveld 408576698