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_; |