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

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

Issue 2555913002: Implement origin specific Permissions Blacklisting. (Closed)
Patch Set: Comments Created 3 years, 11 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 | « no previous file | chrome/browser/permissions/permission_context_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 472c89a50a0a110093003dec0bd40985baf2bf13..15a32a03dfbfca1111b92bb9c3b088cf58b2ef52 100644
--- a/chrome/browser/permissions/permission_context_base.h
+++ b/chrome/browser/permissions/permission_context_base.h
@@ -28,6 +28,10 @@ namespace content {
class WebContents;
}
+namespace safe_browsing {
+class SafeBrowsingDatabaseManager;
+}
+
using BrowserPermissionCallback = base::Callback<void(ContentSetting)>;
// This base class contains common operations for granting permissions.
@@ -80,7 +84,9 @@ class PermissionContextBase : public KeyedService {
bool user_gesture,
const BrowserPermissionCallback& callback);
- // Returns whether the permission has been granted, denied...
+ // Returns whether the permission has been granted, denied etc.
+ // TODO(meredithl): Ensure that the result accurately reflects whether the
+ // origin is blacklisted for this permission.
ContentSetting GetPermissionStatus(const GURL& requesting_origin,
const GURL& embedding_origin) const;
@@ -164,9 +170,26 @@ class PermissionContextBase : public KeyedService {
// Called when a request is no longer used so it can be cleaned up.
void CleanUpRequest(const PermissionRequestID& id);
+ // Called when the requesting origin and permission have been checked by Safe
+ // Browsing. |permission_blocked| determines whether to auto-block the
+ // permission request without prompting the user for a decision.
+ void ContinueRequestPermission(content::WebContents* web_contents,
+ const PermissionRequestID& id,
+ const GURL& requesting_origin,
+ const GURL& embedding_origin,
+ bool user_gesture,
+ const BrowserPermissionCallback& callback,
+ bool permission_blocked);
+
+ void SetSafeBrowsingDatabaseManagerAndTimeoutForTest(
+ scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager> db_manager,
+ int timeout);
+
Profile* profile_;
const content::PermissionType permission_type_;
const ContentSettingsType content_settings_type_;
+ int safe_browsing_timeout_;
+ scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager> db_manager_;
#if defined(OS_ANDROID)
std::unique_ptr<PermissionQueueController> permission_queue_controller_;
#endif
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_context_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698