Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1350)

Unified Diff: chrome/browser/extensions/extension_install_checker.h

Issue 2737053002: Update ExtensionInstallChecker to use PreloadCheck classes (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/extensions/extension_install_checker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/extensions/extension_install_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698