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

Unified Diff: extensions/browser/user_script_loader.cc

Issue 1140173003: Allow whitelisted content scripts to be injected in WebViews. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@document_has_focus
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
Index: extensions/browser/user_script_loader.cc
diff --git a/extensions/browser/user_script_loader.cc b/extensions/browser/user_script_loader.cc
index 7daf95d22fe367431d9002748da60ff7b3245439..be4fa0d8e04031c5a385313eebc69743cafc9021 100644
--- a/extensions/browser/user_script_loader.cc
+++ b/extensions/browser/user_script_loader.cc
@@ -378,9 +378,9 @@ void UserScriptLoader::OnScriptsLoaded(
void UserScriptLoader::SendUpdate(content::RenderProcessHost* process,
base::SharedMemory* shared_memory,
const std::set<HostID>& changed_hosts) {
- // Don't allow injection of extensions' content scripts into <webview>.
- if (process->IsIsolatedGuest() && host_id().id().empty())
- return;
+ // Don't allow injection of non-whitelisted extensions' content scripts
+ // into <webview>.
+ bool whitelisted_only = process->IsIsolatedGuest() && host_id().id().empty();
// Make sure we only send user scripts to processes in our browser_context.
if (!ExtensionsBrowserClient::Get()->IsSameContext(
@@ -399,7 +399,9 @@ void UserScriptLoader::SendUpdate(content::RenderProcessHost* process,
if (base::SharedMemory::IsHandleValid(handle_for_process)) {
process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process,
- host_id(), changed_hosts));
+ host_id(),
+ changed_hosts,
+ whitelisted_only));
}
}

Powered by Google App Engine
This is Rietveld 408576698