| Index: chrome/browser/extensions/installed_loader.cc
|
| diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc
|
| index 4a53315a20ef6255a0833a953b01b2a409c3c7b3..70d41114c4e6dbebd51989d42ae4fa742c520639 100644
|
| --- a/chrome/browser/extensions/installed_loader.cc
|
| +++ b/chrome/browser/extensions/installed_loader.cc
|
| @@ -5,6 +5,9 @@
|
| #include "chrome/browser/extensions/installed_loader.h"
|
|
|
| #include <stddef.h>
|
| +#include <memory>
|
| +#include <string>
|
| +#include <vector>
|
|
|
| #include "base/files/file_path.h"
|
| #include "base/metrics/histogram_macros.h"
|
| @@ -204,16 +207,28 @@ void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) {
|
| if (extension.get()) {
|
| Extension::DisableReason disable_reason = Extension::DISABLE_NONE;
|
| bool force_disabled = false;
|
| - if (!policy->UserMayLoad(extension.get(), NULL)) {
|
| + if (!policy->UserMayLoad(extension.get(), nullptr)) {
|
| // The error message from UserMayInstall() often contains the extension ID
|
| // and is therefore not well suited to this UI.
|
| error = errors::kDisabledByPolicy;
|
| extension = NULL;
|
| } else if (!extension_prefs_->IsExtensionDisabled(extension->id()) &&
|
| - policy->MustRemainDisabled(
|
| - extension.get(), &disable_reason, NULL)) {
|
| + policy->MustRemainDisabled(extension.get(), &disable_reason,
|
| + nullptr)) {
|
| extension_prefs_->SetExtensionDisabled(extension->id(), disable_reason);
|
| force_disabled = true;
|
| + } else if (extension_prefs_->IsExtensionDisabled(extension->id()) &&
|
| + policy->MustRemainEnabled(extension.get(), nullptr) &&
|
| + extension_prefs_->HasDisableReason(
|
| + extension->id(), Extension::DISABLE_CORRUPTED)) {
|
| + // This extension must have been disabled due to corruption on a previous
|
| + // run of chrome, and for some reason we weren't successful in
|
| + // auto-reinstalling it. So we want to notify the PendingExtensionManager
|
| + // that we'd still like to keep attempt to re-download and reinstall it
|
| + // whenever the ExtensionService checks for external updates.
|
| + PendingExtensionManager* pending_manager =
|
| + extension_service_->pending_extension_manager();
|
| + pending_manager->ExpectPolicyReinstallForCorruption(extension->id());
|
| }
|
| UMA_HISTOGRAM_BOOLEAN("ExtensionInstalledLoader.ForceDisabled",
|
| force_disabled);
|
|
|