Index: chrome/browser/extensions/active_tab_permission_granter.h |
diff --git a/chrome/browser/extensions/active_tab_permission_granter.h b/chrome/browser/extensions/active_tab_permission_granter.h |
index a1245a280fd6b355cbe075589e2b816b99c2c86c..13de1ad1c7bf1cfab977d40d26c10a587133f000 100644 |
--- a/chrome/browser/extensions/active_tab_permission_granter.h |
+++ b/chrome/browser/extensions/active_tab_permission_granter.h |
@@ -32,11 +32,26 @@ class ActiveTabPermissionGranter |
: public content::WebContentsObserver, |
public extensions::ExtensionRegistryObserver { |
public: |
+ // Platform specific delegate. |
+ class Delegate { |
+ public: |
+ virtual ~Delegate() {} |
+ // Platform specific check whether the activeTab permission is allowed. |
+ virtual bool ShouldGrantActiveTab( |
+ const Extension* extension, content::WebContents* web_contents) = 0; |
+ }; |
+ |
ActiveTabPermissionGranter(content::WebContents* web_contents, |
int tab_id, |
Profile* profile); |
~ActiveTabPermissionGranter() override; |
+ // Platform specific delegate should be set during startup. |delegate| is a |
+ // singleton instance and is leaked. |
+ static void SetPlatformDelegate(Delegate* delegate); |
+ |
+ static void FreePlatformDelegateForTesting(); |
+ |
// If |extension| has the activeTab or tabCapture permission, grants |
// tab-specific permissions to it until the next page navigation or refresh. |
void GrantIfRequested(const Extension* extension); |