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

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

Issue 934753005: Automatically grant permissions to default-installed extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gah, comment 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 | « no previous file | extensions/common/permissions/permissions_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index adc9e4fe7f33a096cd8d73c65f75ab6356339d2a..ef2d572e69b1588a48ed075f8dfb4d78967b097f 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1583,21 +1583,19 @@ void ExtensionService::CheckPermissionsIncrease(const Extension* extension,
// can upgrade without requiring this user's approval.
int disable_reasons = extension_prefs_->GetDisableReasons(extension->id());
+ // Silently grant all active permissions to default apps and apps installed
+ // in kiosk mode.
bool auto_grant_permission =
- (!is_extension_installed && extension->was_installed_by_default()) ||
+ extension->was_installed_by_default() ||
extensions::ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode();
- // Silently grant all active permissions to default apps only on install.
- // After install they should behave like other apps.
- // Silently grant all active permissions to apps install in kiosk mode on both
- // install and update.
if (auto_grant_permission)
GrantPermissions(extension);
bool is_privilege_increase = false;
// We only need to compare the granted permissions to the current permissions
- // if the extension is not allowed to silently increase its permissions.
- if (!extensions::PermissionsData::CanSilentlyIncreasePermissions(extension) &&
- !auto_grant_permission) {
+ // if the extension has not been auto-granted its permissions above and is
+ // installed internally.
+ if (extension->location() == Manifest::INTERNAL && !auto_grant_permission) {
// Add all the recognized permissions if the granted permissions list
// hasn't been initialized yet.
scoped_refptr<PermissionSet> granted_permissions =
« no previous file with comments | « no previous file | extensions/common/permissions/permissions_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698