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

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

Issue 1200833004: Apps&Extensions for Supervised Users: send permission request on outdated re-enables (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 6 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/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 16c3a6b5a46fcef99b55f4de0f248a4767fc4121..389220cc36f36a752f0c9e5d00d9b85dcee7b1c5 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1679,8 +1679,12 @@ void ExtensionService::CheckPermissionsIncrease(const Extension* extension,
#if defined(ENABLE_SUPERVISED_USERS)
// If a custodian-installed extension is disabled for a supervised user due
// to a permissions increase, send a request to the custodian, since the
- // supervised user themselves can't re-enable the extension.
- if (extensions::util::IsExtensionSupervised(extension, profile_)) {
+ // supervised user themselves can't re-enable the extension. If it's already
+ // disabled due to a permissions increase though, there's no need to send
+ // another request.
+ if (extensions::util::IsExtensionSupervised(extension, profile_) &&
+ !extension_prefs_->HasDisableReason(
+ extension->id(), Extension::DISABLE_PERMISSIONS_INCREASE)) {
Marc Treib 2015/06/22 15:35:18 This is really unrelated; I just discovered the du
not at google - send to devlin 2015/06/22 21:03:10 Should the check be on line 1672-3 instead?
Marc Treib 2015/06/23 10:22:25 Hmm.. maybe? Lines 1673 and 1677 are irrelevant in
not at google - send to devlin 2015/06/24 00:25:10 Ohh right. I think at this point the prefs contain
Marc Treib 2015/06/24 11:50:57 Hm. DidExtensionEscalatePermissions checks for DIS
not at google - send to devlin 2015/06/24 20:47:38 From purely an interface perspective - without loo
Marc Treib 2015/06/29 09:52:49 Hm. Right now, if the extension doesn't come from
SupervisedUserService* supervised_user_service =
SupervisedUserServiceFactory::GetForProfile(profile_);
supervised_user_service->AddExtensionUpdateRequest(
@@ -1689,11 +1693,8 @@ void ExtensionService::CheckPermissionsIncrease(const Extension* extension,
}
#endif
}
- if (disable_reasons != Extension::DISABLE_NONE) {
- extension_prefs_->AddDisableReason(
- extension->id(),
- static_cast<Extension::DisableReason>(disable_reasons));
- }
+ if (disable_reasons != Extension::DISABLE_NONE)
+ extension_prefs_->AddDisableReasons(extension->id(), disable_reasons);
}
void ExtensionService::UpdateActiveExtensionsInCrashReporter() {

Powered by Google App Engine
This is Rietveld 408576698