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

Unified Diff: extensions/common/permissions/permissions_data.cc

Issue 288453002: Don't require user action for active scripts for component or policy exts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaner checks Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/permissions/permissions_data.cc
diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc
index 809865d46fafd862e15bff12e07a6504ab3331b7..65359d9950954bd8496fa38b5d6b1dfff2da1c5f 100644
--- a/extensions/common/permissions/permissions_data.cc
+++ b/extensions/common/permissions/permissions_data.cc
@@ -564,8 +564,12 @@ bool PermissionsData::CanCaptureVisiblePage(const Extension* extension,
bool PermissionsData::RequiresActionForScriptExecution(
const Extension* extension) {
// For now, the user should be notified when an extension with all hosts
- // permission tries to execute a script on a page.
- return HasEffectiveAccessToAllHosts(extension);
+ // permission tries to execute a script on a page. Exceptions for policy-
+ // enabled and component extensions.
+ return extension->ShouldDisplayInExtensionSettings() &&
+ !Manifest::IsPolicyLocation(extension->location()) &&
+ !Manifest::IsComponentLocation(extension->location()) &&
+ HasEffectiveAccessToAllHosts(extension);
}
bool PermissionsData::ParsePermissions(Extension* extension,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698