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

Unified Diff: extensions/renderer/extension_injection_host.cc

Issue 922403002: [Extensions] Adjust script injection reporting to the browser side (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/extension_injection_host.h ('k') | extensions/renderer/injection_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/extension_injection_host.cc
diff --git a/extensions/renderer/extension_injection_host.cc b/extensions/renderer/extension_injection_host.cc
index a3783d94f20e0d4ebd83eb7f64be9f0b440cb6a1..5b3c463b0b8e909938696b50f569b3fc3a62ad27 100644
--- a/extensions/renderer/extension_injection_host.cc
+++ b/extensions/renderer/extension_injection_host.cc
@@ -55,4 +55,14 @@ PermissionsData::AccessType ExtensionInjectionHost::CanExecuteOnFrame(
}
}
+bool ExtensionInjectionHost::ShouldNotifyBrowserOfInjection() const {
+ // We notify the browser of any injection if the extension has no withheld
+ // permissions (i.e., the permissions weren't restricted), but would have
+ // otherwise been affected by the scripts-require-action feature.
+ return extension_->permissions_data()->withheld_permissions()->IsEmpty() &&
+ PermissionsData::ScriptsMayRequireActionForExtension(
+ extension_.get(),
+ extension_->permissions_data()->active_permissions().get());
+}
+
} // namespace extensions
« no previous file with comments | « extensions/renderer/extension_injection_host.h ('k') | extensions/renderer/injection_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698