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

Unified Diff: extensions/renderer/user_script_set.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/user_script_injector.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/user_script_set.cc
diff --git a/extensions/renderer/user_script_set.cc b/extensions/renderer/user_script_set.cc
index e95843d392880bebd48ce1b26bdfebce5b903951..1d66aaa1e9660c7f6f5d7dcd27cefa9cb6d9f4ea 100644
--- a/extensions/renderer/user_script_set.cc
+++ b/extensions/renderer/user_script_set.cc
@@ -4,11 +4,13 @@
#include "extensions/renderer/user_script_set.h"
+#include "base/memory/ref_counted.h"
#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_thread.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/permissions/permissions_data.h"
+#include "extensions/renderer/extension_injection_host.h"
#include "extensions/renderer/extensions_renderer_client.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/script_injection.h"
@@ -194,8 +196,11 @@ scoped_ptr<ScriptInjection> UserScriptSet::GetInjectionForScript(
scoped_ptr<ScriptInjector> injector(new UserScriptInjector(script,
this,
is_declarative));
+ HostID host_id(HostID::EXTENSIONS, extension->id());
+ ExtensionInjectionHost extension_injection_host(
+ make_scoped_refptr<const Extension>(extension));
if (injector->CanExecuteOnFrame(
- extension,
+ &extension_injection_host,
web_frame,
-1, // Content scripts are not tab-specific.
web_frame->top()->document().url()) ==
@@ -211,7 +216,7 @@ scoped_ptr<ScriptInjection> UserScriptSet::GetInjectionForScript(
injection.reset(new ScriptInjection(
injector.Pass(),
web_frame->toWebLocalFrame(),
- extension->id(),
+ host_id,
run_location,
tab_id));
}
« no previous file with comments | « extensions/renderer/user_script_injector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698