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

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

Issue 2019423007: Re-enable extensions disabled due to permission increase if they have all permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext_update_test
Patch Set: Created 4 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
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index ec655826097929a9ff47b9ef21562f9043d78ad8..edca444c0571161e04fbc7401cbf2d1b314b8df7 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1640,6 +1640,16 @@ void ExtensionService::CheckPermissionsIncrease(const Extension* extension,
if (!is_privilege_increase)
disable_reasons |= Extension::DISABLE_USER_ACTION;
}
+
+ // If the extension is disabled due to a permissions increase, but does in
+ // fact have all permissions, remove that disable reason.
Devlin 2016/06/02 16:06:45 Might also be worth adding a TODO to decide whethe
Marc Treib 2016/06/02 16:36:14 Yup, that's the main reason I hadn't actually sent
Devlin 2016/06/03 15:26:58 Whoops, sorry for jumping the gun. Looked from th
+ if (previously_disabled && !is_privilege_increase &&
+ (disable_reasons & Extension::DISABLE_PERMISSIONS_INCREASE)) {
+ // Remove the DISABLE_UNKNOWN_FROM_SYNC reason.
+ disable_reasons &= ~Extension::DISABLE_PERMISSIONS_INCREASE;
+ extension_prefs_->RemoveDisableReason(
+ extension->id(), Extension::DISABLE_PERMISSIONS_INCREASE);
+ }
}
// Extension has changed permissions significantly. Disable it. A
@@ -1668,7 +1678,10 @@ void ExtensionService::CheckPermissionsIncrease(const Extension* extension,
}
#endif
}
- if (disable_reasons != Extension::DISABLE_NONE)
+
+ if (disable_reasons == Extension::DISABLE_NONE)
+ extension_prefs_->SetExtensionEnabled(extension->id());
+ else
extension_prefs_->SetExtensionDisabled(extension->id(), disable_reasons);
}

Powered by Google App Engine
This is Rietveld 408576698