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

Unified Diff: chrome/browser/extensions/permissions_updater.cc

Issue 874683005: [Extensions] Enable the scripts-require-action feature based on all-urls pref (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
Index: chrome/browser/extensions/permissions_updater.cc
diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc
index 6a68371beee3eaf40cc2d27d316724ca6ea0baa1..92ecb30d447a20675983bbccac83b567537e12ed 100644
--- a/chrome/browser/extensions/permissions_updater.cc
+++ b/chrome/browser/extensions/permissions_updater.cc
@@ -182,14 +182,13 @@ void PermissionsUpdater::InitializePermissions(const Extension* extension) {
bounded_active = GetBoundedActivePermissions(extension, active_permissions);
}
- // Withhold permissions if the switch applies to this extension.
- // Non-transient extensions also must not have the preference to allow
- // scripting on all urls.
- bool should_withhold_permissions =
- util::ScriptsMayRequireActionForExtension(extension);
- if ((init_flag_ & INIT_FLAG_TRANSIENT) == 0) {
- should_withhold_permissions &=
- !util::AllowedScriptingOnAllUrls(extension->id(), browser_context_);
+ // Determine whether or not to withhold host permissions.
+ bool should_withhold_permissions = false;
+ if (util::ScriptsMayRequireActionForExtension(extension, bounded_active)) {
+ should_withhold_permissions =
+ init_flag_ & INIT_FLAG_TRANSIENT ?
+ !util::DefaultAllowedScriptingOnAllUrls() :
+ !util::AllowedScriptingOnAllUrls(extension->id(), browser_context_);
}
URLPatternSet granted_explicit_hosts;

Powered by Google App Engine
This is Rietveld 408576698