| Index: chrome/browser/extensions/extension_service.cc
|
| diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
|
| index 51ec084afecd811f465e2e18d5a70c78931917b6..abd7b14e0f18900c62b15e84530ddd82e32cfac1 100644
|
| --- a/chrome/browser/extensions/extension_service.cc
|
| +++ b/chrome/browser/extensions/extension_service.cc
|
| @@ -2111,7 +2111,8 @@ void ExtensionService::UpdateActiveExtensionsInCrashReporter() {
|
| void ExtensionService::OnExtensionInstalled(
|
| const Extension* extension,
|
| bool from_webstore,
|
| - const StringOrdinal& page_ordinal) {
|
| + const StringOrdinal& page_ordinal,
|
| + bool has_requirement_errors) {
|
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| // Ensure extension is deleted unless we transfer ownership.
|
| @@ -2158,6 +2159,20 @@ void ExtensionService::OnExtensionInstalled(
|
| }
|
| }
|
|
|
| + // Unsupported requirements overrides the management policy.
|
| + if (has_requirement_errors) {
|
| + initial_enable = false;
|
| + extension_prefs_->AddDisableReason(
|
| + id, Extension::DISABLE_UNSUPPORTED_REQUIREMENT);
|
| + // If the extension was disabled because of unsupported requirements but
|
| + // now supports all requirements after an update and there are not other
|
| + // disable reasons, enable it.
|
| + } else if (extension_prefs_->GetDisableReasons(id) ==
|
| + Extension::DISABLE_UNSUPPORTED_REQUIREMENT) {
|
| + initial_enable = true;
|
| + extension_prefs_->ClearDisableReasons(id);
|
| + }
|
| +
|
| int include_mask = INCLUDE_ENABLED;
|
| include_mask |= INCLUDE_DISABLED;
|
| // Do not record the install histograms for upgrades.
|
|
|