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

Unified Diff: chrome/browser/extensions/active_tab_permission_granter.h

Issue 2858013002: PS - Showing permission prompt for activeTab (Closed)
Patch Set: Rebase Created 3 years, 7 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
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..3399ebbd6af3bf274e962c5445b4c9b876775c92 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.h
+++ b/chrome/browser/extensions/active_tab_permission_granter.h
@@ -32,11 +32,24 @@ class ActiveTabPermissionGranter
: public content::WebContentsObserver,
public extensions::ExtensionRegistryObserver {
public:
+ // Platform specific delegate.
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+ // Platform specific check whether the user granted activeTab permission.
Devlin 2017/05/12 14:56:45 I think rather than "whether the user granted acti
Ivan Šandrk 2017/05/12 18:27:44 Good point, done.
+ virtual bool ActiveTabPermissionGranted(
Devlin 2017/05/12 14:56:45 "ActiveTabPermissionGranted" is a strange name for
Ivan Šandrk 2017/05/12 18:27:44 Another good one, done.
+ 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);
+
// 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);

Powered by Google App Engine
This is Rietveld 408576698