| Index: extensions/renderer/user_script_injector.cc
|
| diff --git a/extensions/renderer/user_script_injector.cc b/extensions/renderer/user_script_injector.cc
|
| index 73ac9f60a839a44787e079db87d84a7847e8bf24..0d7a47041632f98b9a971124752e87adefc9c36b 100644
|
| --- a/extensions/renderer/user_script_injector.cc
|
| +++ b/extensions/renderer/user_script_injector.cc
|
| @@ -122,7 +122,7 @@ bool UserScriptInjector::ShouldInjectCss(
|
| }
|
|
|
| PermissionsData::AccessType UserScriptInjector::CanExecuteOnFrame(
|
| - const Extension* extension,
|
| + const Host* host,
|
| blink::WebFrame* web_frame,
|
| int tab_id,
|
| const GURL& top_url) const {
|
| @@ -133,27 +133,8 @@ PermissionsData::AccessType UserScriptInjector::CanExecuteOnFrame(
|
|
|
| GURL effective_document_url = ScriptContext::GetEffectiveDocumentURL(
|
| web_frame, web_frame->document().url(), script_->match_about_blank());
|
| -
|
| - // Declarative user scripts use "page access" (from "permissions" section in
|
| - // manifest) whereas non-declarative user scripts use custom
|
| - // "content script access" logic.
|
| - if (is_declarative_) {
|
| - return extension->permissions_data()->GetPageAccess(
|
| - extension,
|
| - effective_document_url,
|
| - top_url,
|
| - tab_id,
|
| - -1, // no process id
|
| - NULL /* ignore error */);
|
| - } else {
|
| - return extension->permissions_data()->GetContentScriptAccess(
|
| - extension,
|
| - effective_document_url,
|
| - top_url,
|
| - tab_id,
|
| - -1, // no process id
|
| - NULL /* ignore error */);
|
| - }
|
| + return host->CanExecuteOnFrame(
|
| + effective_document_url, top_url, tab_id, is_declarative_);
|
| }
|
|
|
| std::vector<blink::WebScriptSource> UserScriptInjector::GetJsSources(
|
|
|