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

Unified Diff: extensions/renderer/script_injection.cc

Issue 309533007: Refactor PermissionsData pt1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 6 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/dispatcher.cc ('k') | extensions/renderer/user_script_scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_injection.cc
diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc
index d3113cdabe8f3f951cd1d663e1127a7a72e3d399..007c985c3c35f016515fc7b5bc435d2a598ae384 100644
--- a/extensions/renderer/script_injection.cc
+++ b/extensions/renderer/script_injection.cc
@@ -154,10 +154,10 @@ void ScriptInjection::InjectIfAllowed(blink::WebFrame* frame,
// valid tab id (if we don't have a tab id, we have no UI surface to ask for
// user consent).
if (tab_id != -1 &&
- PermissionsData::RequiresActionForScriptExecution(
- extension,
- tab_id,
- frame->top()->document().url())) {
+ PermissionsData::ForExtension(extension)
+ ->RequiresActionForScriptExecution(extension,
+ tab_id,
+ frame->top()->document().url())) {
int64 request_id = kInvalidRequestId;
int page_id = top_render_view->GetPageId();
@@ -256,13 +256,14 @@ bool ScriptInjection::WantsToRun(blink::WebFrame* frame,
GURL effective_document_url = ScriptContext::GetEffectiveDocumentURL(
frame, document_url, script_->match_about_blank());
- if (!PermissionsData::CanExecuteScriptOnPage(extension,
- effective_document_url,
- frame->top()->document().url(),
- kNoTabId,
- script_.get(),
- kNoProcessId,
- NULL /* ignore error */)) {
+ if (!PermissionsData::ForExtension(extension)
+ ->CanExecuteScriptOnPage(extension,
+ effective_document_url,
+ frame->top()->document().url(),
+ kNoTabId,
+ script_.get(),
+ kNoProcessId,
+ NULL /* ignore error */)) {
return false;
}
« no previous file with comments | « extensions/renderer/dispatcher.cc ('k') | extensions/renderer/user_script_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698