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

Unified Diff: extensions/renderer/programmatic_script_injector.cc

Issue 1150683007: [Extensions] Use document url (not top url) for tab-specific permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix extension page content scripts Created 5 years, 7 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
Index: extensions/renderer/programmatic_script_injector.cc
diff --git a/extensions/renderer/programmatic_script_injector.cc b/extensions/renderer/programmatic_script_injector.cc
index 4546d93d1451beb62fa0b8b4b70454caeb1fae5d..49d87b9d8ebd06ff6443a71379aeb849b392138f 100644
--- a/extensions/renderer/programmatic_script_injector.cc
+++ b/extensions/renderer/programmatic_script_injector.cc
@@ -66,8 +66,7 @@ bool ProgrammaticScriptInjector::ShouldInjectCss(
PermissionsData::AccessType ProgrammaticScriptInjector::CanExecuteOnFrame(
const InjectionHost* injection_host,
blink::WebFrame* frame,
- int tab_id,
- const GURL& top_url) const {
+ int tab_id) const {
// It doesn't make sense to inject a script into a remote frame or a frame
// with a null document.
if (frame->isWebRemoteFrame() || frame->document().isNull())
@@ -87,7 +86,7 @@ PermissionsData::AccessType ProgrammaticScriptInjector::CanExecuteOnFrame(
DCHECK_EQ(injection_host->id().type(), HostID::EXTENSIONS);
return injection_host->CanExecuteOnFrame(
- effective_document_url, top_url, tab_id, true /* is_declarative */);
+ effective_document_url, frame, tab_id, true /* is_declarative */);
}
std::vector<blink::WebScriptSource> ProgrammaticScriptInjector::GetJsSources(

Powered by Google App Engine
This is Rietveld 408576698