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

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

Issue 2783813002: Move ChromeRequirementsChecker to //extensions as a PreloadCheck (Closed)
Patch Set: rebase? Created 3 years, 8 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 17da24274b9bba8494c573e02a5ef64306f8cd5b..767c4667dd88d74c4157f7fa2214a5fadaf845a3 100644
--- a/chrome/browser/extensions/extension_install_checker.h
+++ b/chrome/browser/extensions/extension_install_checker.h
@@ -20,8 +20,6 @@ class Profile;
namespace extensions {
-class RequirementsChecker;
-
// Performs common checks for validating whether an extension may be installed.
// This class should be Start()-ed at most once.
class ExtensionInstallChecker {
@@ -60,10 +58,9 @@ class ExtensionInstallChecker {
// Returns true if any checks are currently running.
bool is_running() const { return running_checks_ != 0; }
- // Returns the requirement violations. A non-empty list is considered to be
- // a check failure.
- const std::vector<std::string>& requirement_errors() const {
- return requirement_errors_;
+ // Returns the error message for requirement violations, if any were found.
+ const base::string16& requirements_error_message() const {
+ return requirements_error_message_;
}
// Returns the blacklist error of the extension. Note that there is only an
@@ -71,7 +68,7 @@ class ExtensionInstallChecker {
PreloadCheck::Error blacklist_error() const { return blacklist_error_; }
// Returns whether management policy permits installation of the extension.
- const std::string& policy_error() const { return policy_error_; }
+ const base::string16& policy_error() const { return policy_error_; }
void SetBlacklistCheckForTesting(std::unique_ptr<PreloadCheck> policy_check) {
blacklist_check_ = std::move(policy_check);
@@ -79,13 +76,17 @@ class ExtensionInstallChecker {
void SetPolicyCheckForTesting(std::unique_ptr<PreloadCheck> policy_check) {
policy_check_ = std::move(policy_check);
}
+ void SetRequirementsCheckForTesting(
+ std::unique_ptr<PreloadCheck> requirements_check) {
+ requirements_check_ = std::move(requirements_check);
+ }
protected:
virtual void CheckManagementPolicy();
void OnManagementPolicyCheckDone(PreloadCheck::Errors errors);
virtual void CheckRequirements();
- void OnRequirementsCheckDone(const std::vector<std::string>& errors);
+ void OnRequirementsCheckDone(PreloadCheck::Errors errors);
virtual void CheckBlacklistState();
void OnBlacklistStateCheckDone(PreloadCheck::Errors errors);
@@ -100,8 +101,8 @@ class ExtensionInstallChecker {
scoped_refptr<const Extension> extension_;
// Checks requirements specified in the manifest.
- std::unique_ptr<RequirementsChecker> requirements_checker_;
- std::vector<std::string> requirement_errors_;
+ std::unique_ptr<PreloadCheck> requirements_check_;
+ base::string16 requirements_error_message_;
// Checks if the extension is blacklisted.
std::unique_ptr<PreloadCheck> blacklist_check_;
@@ -109,7 +110,7 @@ class ExtensionInstallChecker {
// Checks whether management policies allow the extension to be installed.
std::unique_ptr<PreloadCheck> policy_check_;
- std::string policy_error_;
+ base::string16 policy_error_;
// Bitmask of enabled checks.
int 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