| Index: chrome/browser/extensions/extension_install_checker.h
|
| diff --git a/chrome/browser/extensions/extension_install_checker.h b/chrome/browser/extensions/extension_install_checker.h
|
| index 518dc774043858f6caedd2e4ea0888387b898c35..f503c8acb5a3972d808a02124af414b50aaec2a8 100644
|
| --- a/chrome/browser/extensions/extension_install_checker.h
|
| +++ b/chrome/browser/extensions/extension_install_checker.h
|
| @@ -13,7 +13,7 @@
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/strings/string16.h"
|
| -#include "extensions/browser/blacklist_state.h"
|
| +#include "extensions/browser/preload_check.h"
|
| #include "extensions/common/extension.h"
|
|
|
| class Profile;
|
| @@ -68,23 +68,29 @@ class ExtensionInstallChecker {
|
| return requirement_errors_;
|
| }
|
|
|
| - // Returns the blacklist state of the extension. A blacklist state of
|
| + // Returns the blacklist error of the extension. A blacklist state of
|
| // BLACKLISTED_MALWARE is considered to be a check failure.
|
| - BlacklistState blacklist_state() const { return blacklist_state_; }
|
| + PreloadCheck::Error blacklist_error() const { return blacklist_error_; }
|
|
|
| // Returns whether management policy permits installation of the extension.
|
| - bool policy_allows_load() const { return policy_allows_load_; }
|
| const std::string& policy_error() const { return policy_error_; }
|
|
|
| + void SetBlacklistCheckForTesting(std::unique_ptr<PreloadCheck> policy_check) {
|
| + blacklist_check_ = std::move(policy_check);
|
| + }
|
| + void SetPolicyCheckForTesting(std::unique_ptr<PreloadCheck> policy_check) {
|
| + policy_check_ = std::move(policy_check);
|
| + }
|
| +
|
| protected:
|
| virtual void CheckManagementPolicy();
|
| - void OnManagementPolicyCheckDone(bool allows_load, const std::string& error);
|
| + void OnManagementPolicyCheckDone(PreloadCheck::Errors errors);
|
|
|
| virtual void CheckRequirements();
|
| void OnRequirementsCheckDone(const std::vector<std::string>& errors);
|
|
|
| virtual void CheckBlacklistState();
|
| - void OnBlacklistStateCheckDone(BlacklistState state);
|
| + void OnBlacklistStateCheckDone(PreloadCheck::Errors errors);
|
|
|
| private:
|
| void MaybeInvokeCallback();
|
| @@ -100,11 +106,12 @@ class ExtensionInstallChecker {
|
| // Requirement violations.
|
| std::vector<std::string> requirement_errors_;
|
|
|
| - // Result of the blacklist state check.
|
| - BlacklistState blacklist_state_;
|
| + // Checks if the extension in blacklisted.
|
| + std::unique_ptr<PreloadCheck> blacklist_check_;
|
| + PreloadCheck::Error blacklist_error_;
|
|
|
| - // Whether the extension can be installed, according to management policies.
|
| - bool policy_allows_load_;
|
| + // Checks whether management policies allow the extension to be installed.
|
| + std::unique_ptr<PreloadCheck> policy_check_;
|
| std::string policy_error_;
|
|
|
| // Bitmask of enabled checks.
|
|
|