Index: chrome/common/extensions/extension.h |
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h |
index f58d27306fe393ee351e97e020f24d049663b354..0761da0e0ee7b9aa0fe0b2ee7347db127c290207 100644 |
--- a/chrome/common/extensions/extension.h |
+++ b/chrome/common/extensions/extension.h |
@@ -308,20 +308,6 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
// ExtensionService::IsDownloadFromGallery |
static std::string ChromeStoreLaunchURL(); |
- // Helper function that consolidates the check for whether the script can |
- // execute into one location. |page_url| is the page that is the candidate |
- // for running the script, |can_execute_script_everywhere| specifies whether |
- // the extension is on the whitelist, |allowed_pages| is a vector of |
- // URLPatterns, listing what access the extension has, |script| is the script |
- // pointer (if content script) and |error| is an optional parameter, which |
- // will receive the error string listing why access was denied. |
- static bool CanExecuteScriptOnPage( |
- const GURL& page_url, |
- bool can_execute_script_everywhere, |
- const std::vector<URLPattern>* allowed_pages, |
- UserScript* script, |
- std::string* error); |
- |
// Adds an extension to the scripting whitelist. Used for testing only. |
static void SetScriptingWhitelist(const ScriptingWhitelist& whitelist); |
@@ -380,6 +366,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
// Gets the fully resolved absolute launch URL. |
GURL GetFullLaunchURL() const; |
+ |
// Image cache related methods. These are only valid on the UI thread and |
// not maintained by this class. See ImageLoadingTracker for usage. The |
// |original_size| parameter should be the size of the image at |source| |
@@ -391,6 +378,18 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
const gfx::Size& max_size) const; |
SkBitmap GetCachedImage(const ExtensionResource& source, |
const gfx::Size& max_size) const; |
+ |
+ // Returns true if this 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 GURL& page_url, |
+ UserScript* script, |
+ std::string* error) const; |
+ |
// Returns true if this extension is a COMPONENT extension, or if it is |
// on the whitelist of extensions that can script all pages. |
bool CanExecuteScriptEverywhere() const; |