Index: extensions/common/permissions/permissions_data.h |
diff --git a/extensions/common/permissions/permissions_data.h b/extensions/common/permissions/permissions_data.h |
index 8b55c85cebdae642da7e0ba3561ab63ce534569f..eb9b7bad8b211409f9991c8e20e42d6af807c403 100644 |
--- a/extensions/common/permissions/permissions_data.h |
+++ b/extensions/common/permissions/permissions_data.h |
@@ -47,7 +47,6 @@ class PermissionsData { |
const GURL& document_url, |
const GURL& top_document_url, |
int tab_id, |
- const UserScript* script, |
int process_id, |
std::string* error) = 0; |
}; |
@@ -125,20 +124,28 @@ class PermissionsData { |
// display at install time as strings. |
std::vector<base::string16> GetPermissionMessageDetailsStrings() const; |
- // Returns true if the given |extension| can execute script on a page. If a |
- // UserScript object is passed, permission to run that specific script is |
- // checked (using its matches list). Otherwise, permission to execute script |
- // programmatically is checked (using the extension's host permission). |
- // |
- // This method is also aware of certain special pages that extensions are |
- // usually not allowed to run script on. |
- bool CanExecuteScriptOnPage(const Extension* extension, |
- const GURL& document_url, |
- const GURL& top_document_url, |
- int tab_id, |
- const UserScript* script, |
- int process_id, |
- std::string* error) const; |
+ // Returns true if the |extension| has permission to access and interact with |
+ // the specified page, in order to do things like inject scripts or modify |
+ // the content. |
+ // If this returns false and |error| is non-NULL, |error| will be popualted |
+ // with the reason the extension cannot access the page. |
+ bool CanAccessPage(const Extension* extension, |
+ const GURL& document_url, |
+ const GURL& top_document_url, |
+ int tab_id, |
+ int process_id, |
+ std::string* error) const; |
+ |
+ // Returns true if the |extension| has permission to inject a content script |
+ // on the page. |
+ // If this returns false and |error| is non-NULL, |error| will be popualted |
+ // with the reason the extension cannot script the page. |
not at google - send to devlin
2014/06/06 18:46:52
"CanContentScriptPage" ... still looks a little bi
Devlin
2014/06/06 19:25:02
Done and done.
|
+ bool CanContentScriptPage(const Extension* extension, |
+ const GURL& document_url, |
+ const GURL& top_document_url, |
+ int tab_id, |
+ int process_id, |
+ std::string* error) const; |
// Returns true if extension is allowed to obtain the contents of a page as |
// an image. Since a page may contain sensitive information, this is |
@@ -181,6 +188,17 @@ class PermissionsData { |
bool HasTabSpecificPermissionToExecuteScript(int tab_id, |
const GURL& url) const; |
+ // Returns true if the extension is permitted to run on the given page, |
+ // checking against |permitted_url_patterns| in addition to blocking special |
+ // sites (like the webstore or chrome:// urls). |
+ bool CanRunOnPage(const Extension* extension, |
+ const GURL& document_url, |
+ const GURL& top_document_url, |
+ int tab_id, |
+ int process_id, |
+ const URLPatternSet& permitted_url_patterns, |
+ std::string* error) const; |
+ |
// The associated extension's id. |
std::string extension_id_; |