diff options
author | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-07 23:26:19 +0000 |
---|---|---|
committer | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-07 23:26:19 +0000 |
commit | 23a85362dfcde394dd17d7158423dfde35c20ca4 (patch) | |
tree | e4b43c3d0027510e86443488b63cac3a2f0e7770 /extensions/renderer/script_injector.h | |
parent | 801c8663dacdcaccaf8b01efceb78989c56cba87 (diff) | |
download | chromium_src-23a85362dfcde394dd17d7158423dfde35c20ca4.zip chromium_src-23a85362dfcde394dd17d7158423dfde35c20ca4.tar.gz chromium_src-23a85362dfcde394dd17d7158423dfde35c20ca4.tar.bz2 |
Add a withheld permissions model to PermissionsData. Withheld permissions are the permissions which were requested by the extension, but not granted due to how dangerous/powerful they are. Currently, these withheld permissions are only used for all hosts, and only behind the scripts_require_action flag.
BUG=362353
Review URL: https://codereview.chromium.org/348313003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/renderer/script_injector.h')
-rw-r--r-- | extensions/renderer/script_injector.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/extensions/renderer/script_injector.h b/extensions/renderer/script_injector.h index 3bb0651..9b4aca9 100644 --- a/extensions/renderer/script_injector.h +++ b/extensions/renderer/script_injector.h @@ -8,6 +8,7 @@ #include <vector> #include "base/memory/scoped_ptr.h" +#include "extensions/common/permissions/permissions_data.h" #include "extensions/common/user_script.h" #include "third_party/WebKit/public/web/WebScriptSource.h" @@ -34,16 +35,11 @@ class ScriptInjector { // (or just did not accept) the injection. }; - // The possible types of access for a given frame. - enum AccessType { - DENY_ACCESS, // The script cannot access the given frame. - ALLOW_ACCESS, // The script can access the given frame. - REQUEST_ACCESS // The browser must determine if the script can access the - // given frame. - }; - virtual ~ScriptInjector() {} + // Returns the script type of this particular injection. + virtual UserScript::InjectionType script_type() const = 0; + // Returns true if the script should execute in child frames. virtual bool ShouldExecuteInChildFrames() const = 0; @@ -64,10 +60,11 @@ class ScriptInjector { virtual bool ShouldInjectCss(UserScript::RunLocation run_location) const = 0; // Returns true if the script should execute on the given |frame|. - virtual AccessType CanExecuteOnFrame(const Extension* extension, - blink::WebFrame* web_frame, - int tab_id, - const GURL& top_url) const = 0; + virtual PermissionsData::AccessType CanExecuteOnFrame( + const Extension* extension, + blink::WebFrame* web_frame, + int tab_id, + const GURL& top_url) const = 0; // Returns the javascript sources to inject at the given |run_location|. // Only called if ShouldInjectJs() is true. |