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; |