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

Unified Diff: extensions/common/permissions/permissions_data.h

Issue 293003008: Make ActiveScriptController use Active Tab-style permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ben's Created 6 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: extensions/common/permissions/permissions_data.h
diff --git a/extensions/common/permissions/permissions_data.h b/extensions/common/permissions/permissions_data.h
index f4f8bce4c223325294b9d0b7e28be05a01836d2e..b0acf3824215382fab0b5090b24e48f0dc97740d 100644
--- a/extensions/common/permissions/permissions_data.h
+++ b/extensions/common/permissions/permissions_data.h
@@ -135,6 +135,11 @@ class PermissionsData {
// network, etc.)
static bool HasEffectiveAccessToAllHosts(const Extension* extension);
+ // Whether the extension has access to so many hosts that we should treat it
+ // as "all_hosts" for warning purposes.
+ // For example, '*://*.com/*'.
+ static bool ShouldWarnAllHosts(const Extension* extension);
+
// Returns the full list of permission messages that the given |extension|
// should display at install time.
static PermissionMessages GetPermissionMessages(const Extension* extension);
@@ -179,7 +184,9 @@ class PermissionsData {
// Returns true if the user should be alerted that the |extension| is running
// a script.
- static bool RequiresActionForScriptExecution(const Extension* extension);
+ static bool RequiresActionForScriptExecution(const Extension* extension,
+ int tab_id,
+ const GURL& url);
// Parse the permissions of a given extension in the initialization process.
bool ParsePermissions(Extension* extension, base::string16* error);
@@ -194,6 +201,14 @@ class PermissionsData {
struct InitialPermissions;
typedef std::map<int, scoped_refptr<const PermissionSet> > TabPermissionsMap;
+ // Returns true if the |extension| has tab-specific permission to operate on
+ // the tab specified by |tab_id| with the given |url|.
+ // Note that if this returns false, it doesn't mean the extension can't run on
+ // the given tab, only that it does not have tab-specific permission to do so.
+ static bool HasTabSpecificScriptPermission(const Extension* extension,
not at google - send to devlin 2014/05/21 23:33:45 well it seems like it can be in an anonymous names
Devlin 2014/05/22 15:52:14 Done.
+ int tab_id,
+ const GURL& url);
+
// Temporary permissions during the initialization process; NULL after
// initialization completes.
scoped_ptr<InitialPermissions> initial_required_permissions_;

Powered by Google App Engine
This is Rietveld 408576698