Index: extensions/renderer/script_injection.cc |
diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc |
index f3a55a2d06c77a100d4a6105721877fd543e6f52..5e5cc20076d449d3d93f5a0376af76c2d407a1d0 100644 |
--- a/extensions/renderer/script_injection.cc |
+++ b/extensions/renderer/script_injection.cc |
@@ -114,11 +114,13 @@ ScriptInjection::ScriptInjection( |
scoped_ptr<ScriptInjector> injector, |
blink::WebLocalFrame* web_frame, |
const HostID& host_id, |
+ const UserScript::ConsumerInstanceType& consumer_instance_type, |
UserScript::RunLocation run_location, |
int tab_id) |
: injector_(injector.Pass()), |
web_frame_(web_frame), |
host_id_(host_id), |
+ consumer_instance_type_(consumer_instance_type), |
run_location_(run_location), |
tab_id_(tab_id), |
request_id_(kInvalidRequestId), |
@@ -174,13 +176,18 @@ bool ScriptInjection::OnPermissionGranted(const InjectionHost* injection_host, |
} |
void ScriptInjection::RequestPermission() { |
+ if (host_id_.type() != HostID::EXTENSIONS) |
Devlin
2015/02/23 20:15:00
I think this needs to be rebased.
Xi Han
2015/02/24 16:19:55
Done.
|
+ return; |
+ |
content::RenderView* render_view = |
content::RenderView::FromWebView(web_frame()->top()->view()); |
// If we are just notifying the browser of the injection, then send an |
// invalid request (which is treated like a notification). |
- request_id_ = ShouldNotifyBrowserOfInjections() ? kInvalidRequestId |
- : g_next_pending_id++; |
+ request_id_ = consumer_instance_type_ == |
+ UserScript::ConsumerInstanceType::WEBVIEW || |
+ ShouldNotifyBrowserOfInjections() ? kInvalidRequestId |
+ : g_next_pending_id++; |
render_view->Send(new ExtensionHostMsg_RequestScriptInjectionPermission( |
render_view->GetRoutingID(), |
host_id_.id(), |