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

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: 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
« no previous file with comments | « extensions/renderer/programmatic_script_injector.h ('k') | extensions/renderer/script_injection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..db2fdcc6ff4180cd3e50ebe44827db6bf662ae55 100644
--- a/extensions/renderer/programmatic_script_injector.cc
+++ b/extensions/renderer/programmatic_script_injector.cc
@@ -8,6 +8,7 @@
#include "base/values.h"
#include "content/public/common/url_constants.h"
+#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension_messages.h"
@@ -66,8 +67,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 +87,10 @@ 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,
+ content::RenderFrame::FromWebFrame(frame),
+ tab_id,
+ true /* is_declarative */);
}
std::vector<blink::WebScriptSource> ProgrammaticScriptInjector::GetJsSources(
« no previous file with comments | « extensions/renderer/programmatic_script_injector.h ('k') | extensions/renderer/script_injection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698