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

Unified Diff: chrome/common/extensions/extension.h

Issue 6242010: Refactor away most of ExtensionRendererInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 11 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
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698