Chromium Code Reviews| 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); |
| } |