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

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

Issue 480133002: Only show the checkbox for all urls when the switch is on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 798717cacf8773f5140ff7b44d20be7cc299ed2c..f28ecdd9057d92101a9afb4bd0e2d617a92f2c9a 100644
--- a/chrome/browser/extensions/permissions_updater.cc
+++ b/chrome/browser/extensions/permissions_updater.cc
@@ -20,7 +20,6 @@
#include "extensions/browser/extension_prefs.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
-#include "extensions/common/feature_switch.h"
#include "extensions/common/manifest_handlers/permissions_parser.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/permissions/permissions_data.h"
@@ -170,17 +169,10 @@ void PermissionsUpdater::InitializePermissions(const Extension* extension) {
scoped_refptr<const PermissionSet> bounded_active =
GetBoundedActivePermissions(extension, active_permissions);
- // We withhold permissions iff the switch to do so is enabled, the extension
- // shows up in chrome:extensions (so the user can grant withheld permissions),
- // the extension is not part of chrome or corporate policy, and also not on
- // the scripting whitelist. Additionally, we don't withhold if the extension
- // has the preference to allow scripting on all urls.
+ // Withhold permissions only if the switch applies to this extension and the
+ // extension doesn't have the preference to allow scripting on all urls.
bool should_withhold_permissions =
- FeatureSwitch::scripts_require_action()->IsEnabled() &&
- extension->ShouldDisplayInExtensionSettings() &&
- !Manifest::IsPolicyLocation(extension->location()) &&
- !Manifest::IsComponentLocation(extension->location()) &&
- !PermissionsData::CanExecuteScriptEverywhere(extension) &&
+ util::ScriptsMayRequireActionForExtension(extension) &&
!util::AllowedScriptingOnAllUrls(extension->id(), browser_context_);
URLPatternSet granted_explicit_hosts;
« no previous file with comments | « chrome/browser/extensions/extension_util.cc ('k') | chrome/browser/ui/webui/extensions/extension_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698