Chromium Code Reviews| Index: extensions/renderer/user_script_injector.cc |
| diff --git a/extensions/renderer/user_script_injector.cc b/extensions/renderer/user_script_injector.cc |
| index c3e15ef36e909c4a9cd0ec3568f226e1ce252587..c2dd25be9b984a35470941f76d66e4012cf3ebf1 100644 |
| --- a/extensions/renderer/user_script_injector.cc |
| +++ b/extensions/renderer/user_script_injector.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/lazy_instance.h" |
| #include "content/public/common/url_constants.h" |
| +#include "content/public/renderer/render_view.h" |
| #include "extensions/common/extension.h" |
| #include "extensions/common/permissions/permissions_data.h" |
| #include "extensions/renderer/injection_host.h" |
| @@ -132,6 +133,13 @@ PermissionsData::AccessType UserScriptInjector::CanExecuteOnFrame( |
| if (tab_id == -1) |
| return PermissionsData::ACCESS_ALLOWED; |
| + int routing_id = content::RenderView::FromWebView(web_frame->top()->view()) |
| + ->GetRoutingID(); |
| + if (script_->routing_info().render_view_id == routing_id && |
|
Devlin
2015/02/23 20:15:00
Should this just work with the injection host call
Xi Han
2015/02/24 16:19:55
It seems in current implementation, all webview re
Devlin
2015/02/25 17:14:38
While that's true, the reason all webview logic is
Xi Han
2015/02/27 19:36:19
As discussed offline, leave the ScriptInjector::Ca
|
| + script_->consumer_instance_type() == |
| + UserScript::ConsumerInstanceType::WEBVIEW) |
| + return PermissionsData::ACCESS_ALLOWED; |
| + |
| GURL effective_document_url = ScriptContext::GetEffectiveDocumentURL( |
| web_frame, web_frame->document().url(), script_->match_about_blank()); |
| return injection_host->CanExecuteOnFrame( |