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

Unified Diff: extensions/renderer/script_context.h

Issue 498513002: Respect the clipboardRead and clipboardWrite permissions in content scripts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address more comments Created 6 years, 3 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 | « extensions/renderer/module_system_test.cc ('k') | extensions/renderer/script_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_context.h
diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h
index 4b663670bbd8794055e5eadf47d9b99514bc6040..88b596adfa1adf4a1eb9be4bf70cced3cf66100d 100644
--- a/extensions/renderer/script_context.h
+++ b/extensions/renderer/script_context.h
@@ -35,7 +35,9 @@ class ScriptContext : public RequestSender::Source, public gin::Runner {
ScriptContext(const v8::Handle<v8::Context>& context,
blink::WebFrame* frame,
const Extension* extension,
- Feature::Context context_type);
+ Feature::Context context_type,
+ const Extension* effective_extension,
+ Feature::Context effective_context_type);
virtual ~ScriptContext();
// Clears the WebFrame for this contexts and invalidates the associated
@@ -52,10 +54,18 @@ class ScriptContext : public RequestSender::Source, public gin::Runner {
const Extension* extension() const { return extension_.get(); }
+ const Extension* effective_extension() const {
+ return effective_extension_.get();
+ }
+
blink::WebFrame* web_frame() const { return web_frame_; }
Feature::Context context_type() const { return context_type_; }
+ Feature::Context effective_context_type() const {
+ return effective_context_type_;
+ }
+
void set_module_system(scoped_ptr<ModuleSystem> module_system) {
module_system_ = module_system.Pass();
}
@@ -97,6 +107,9 @@ class ScriptContext : public RequestSender::Source, public gin::Runner {
// Returns a string description of the type of context this is.
std::string GetContextTypeDescription();
+ // Returns a string description of the effective type of context this is.
+ std::string GetEffectiveContextTypeDescription();
+
v8::Isolate* isolate() const { return isolate_; }
// Get the URL of this context's web frame.
@@ -152,6 +165,14 @@ class ScriptContext : public RequestSender::Source, public gin::Runner {
// The type of context.
Feature::Context context_type_;
+ // The effective extension associated with this context, or NULL if there is
+ // none. This is different from the above extension if this context is in an
+ // about:blank iframe for example.
+ scoped_refptr<const Extension> effective_extension_;
+
+ // The type of context.
+ Feature::Context effective_context_type_;
+
// Owns and structures the JS that is injected to set up extension bindings.
scoped_ptr<ModuleSystem> module_system_;
« no previous file with comments | « extensions/renderer/module_system_test.cc ('k') | extensions/renderer/script_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698