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

Unified Diff: extensions/renderer/extension_injection_host.cc

Issue 906493004: Refactoring: de-couple Extensions from "script injection System" [render side]:2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_1
Patch Set: resubmit 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
Index: extensions/renderer/extension_injection_host.cc
diff --git a/extensions/renderer/extension_injection_host.cc b/extensions/renderer/extension_injection_host.cc
index 5b3c463b0b8e909938696b50f569b3fc3a62ad27..55ee1cc6b4dec047145471c9688321812c713ba1 100644
--- a/extensions/renderer/extension_injection_host.cc
+++ b/extensions/renderer/extension_injection_host.cc
@@ -29,10 +29,15 @@ const std::string& ExtensionInjectionHost::name() const {
}
PermissionsData::AccessType ExtensionInjectionHost::CanExecuteOnFrame(
- const GURL& document_url,
- const GURL& top_frame_url,
- int tab_id,
- bool is_declarative) const {
+ const GURL& document_url,
+ const GURL& top_frame_url,
+ int tab_id,
+ bool is_declarative) const {
+ // If we don't have a tab id, we have no UI surface to ask for user consent.
+ // For now, we treat this as an automatic allow.
+ if (tab_id == -1)
+ return PermissionsData::ACCESS_ALLOWED;
+
// Declarative user scripts use "page access" (from "permissions" section in
// manifest) whereas non-declarative user scripts use custom
// "content script access" logic.

Powered by Google App Engine
This is Rietveld 408576698