Chromium Code Reviews| Index: chrome/browser/extensions/installed_loader.cc |
| diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc |
| index 197410b5c9b9e188108ab09c1c440e43e1b9a9df..221b765ffcd000afff003bfd1c421f36325127aa 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> |
|
lazyboy
2016/11/16 01:44:53
Do you need these includes? I don't see any new co
asargent_no_longer_on_chrome
2016/11/17 21:48:01
I'm just fixing lint errors since I'm modifying th
lazyboy
2016/11/17 21:59:09
Good to know, thanks.
|
| +#include <string> |
| +#include <vector> |
| #include "base/files/file_path.h" |
| #include "base/metrics/histogram_macros.h" |
| @@ -205,16 +208,23 @@ 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)) { |
| + PendingExtensionManager* pending_manager = |
|
lazyboy
2016/11/16 01:44:53
I'd add a note saying sth that explains this, as i
asargent_no_longer_on_chrome
2016/11/17 21:48:01
Good feedback - I've added a comment.
lazyboy
2016/11/17 21:59:09
Acknowledged.
|
| + extension_service_->pending_extension_manager(); |
| + pending_manager->ExpectPolicyReinstallForCorruption(extension->id()); |
| } |
| UMA_HISTOGRAM_BOOLEAN("ExtensionInstalledLoader.ForceDisabled", |
| force_disabled); |