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

Unified Diff: extensions/renderer/programmatic_script_injector.cc

Issue 885493007: Refactoring: de-couple Extensions from "script injection System" [render side] : 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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.h » ('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 fc7b72bf077aba53f9e1141874911df67bef6f86..f393f9e213a299cf1244d467752264942bd426a6 100644
--- a/extensions/renderer/programmatic_script_injector.cc
+++ b/extensions/renderer/programmatic_script_injector.cc
@@ -9,10 +9,10 @@
#include "base/values.h"
#include "content/public/renderer/render_view.h"
#include "extensions/common/error_utils.h"
-#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/permissions/permissions_data.h"
+#include "extensions/renderer/injection_host.h"
#include "extensions/renderer/script_context.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebDocument.h"
@@ -66,7 +66,7 @@ bool ProgrammaticScriptInjector::ShouldInjectCss(
}
PermissionsData::AccessType ProgrammaticScriptInjector::CanExecuteOnFrame(
- const Extension* extension,
+ const InjectionHost* injection_host,
blink::WebFrame* frame,
int tab_id,
const GURL& top_url) const {
@@ -83,12 +83,8 @@ PermissionsData::AccessType ProgrammaticScriptInjector::CanExecuteOnFrame(
: PermissionsData::ACCESS_DENIED;
}
- return extension->permissions_data()->GetPageAccess(extension,
- effective_document_url,
- top_url,
- tab_id,
- -1, // no process ID.
- NULL /* ignore error */);
+ return injection_host->CanExecuteOnFrame(
+ effective_document_url, top_url, 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.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698