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

Unified Diff: chrome/installer/util/installation_validator.h

Issue 6588003: Add support for the quick-enable-cf command to the installer. This encompase... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
Index: chrome/installer/util/installation_validator.h
===================================================================
--- chrome/installer/util/installation_validator.h (revision 76372)
+++ chrome/installer/util/installation_validator.h (working copy)
@@ -6,6 +6,7 @@
#define CHROME_INSTALLER_UTIL_INSTALLATION_VALIDATOR_H_
#pragma once
+#include <map>
#include <string>
#include <utility>
#include <vector>
@@ -23,6 +24,7 @@
namespace installer {
class InstallationState;
+class ProductCommand;
class ProductState;
// A class that validates the state of an installation. Violations are logged
@@ -76,7 +78,12 @@
InstallationType* type);
protected:
+ struct ProductContext;
typedef std::vector<std::pair<std::string, bool> > SwitchExpectations;
+ typedef void (*CommandValidatorFn)(const ProductContext& ctx,
+ const ProductCommand& command,
+ bool* is_valid);
+ typedef std::map<std::wstring, CommandValidatorFn> CommandExpectations;
// An interface to product-specific validation rules.
class ProductRules {
@@ -112,6 +119,17 @@
SwitchExpectations* expectations) const OVERRIDE;
};
+ // Validation rules for the multi-install Chrome binaries.
+ class ChromeBinariesRules : public ProductRules {
+ public:
+ virtual BrowserDistribution::Type distribution_type() const OVERRIDE;
+ virtual void AddProductSwitchExpectations(
+ const InstallationState& machine_state,
+ bool system_install,
+ const ProductState& product_state,
+ SwitchExpectations* expectations) const OVERRIDE;
+ };
+
struct ProductContext {
const InstallationState& machine_state;
bool system_install;
@@ -120,6 +138,15 @@
const ProductRules& rules;
};
+ static void ValidateQuickEnableCfCommand(const ProductContext& ctx,
+ const ProductCommand& command,
+ bool* is_valid);
+ static void ValidateProductCommandExpectations(
+ const ProductContext& ctx,
+ const CommandExpectations& expectations,
+ bool* is_valid);
+ static void ValidateBinariesCommands(const ProductContext& ctx,
+ bool* is_valid);
static void ValidateBinaries(const InstallationState& machine_state,
bool system_install,
const ProductState& binaries_state,
@@ -143,6 +170,8 @@
bool* is_valid);
static void ValidateMultiInstallProduct(const ProductContext& ctx,
bool* is_valid);
+ static void ValidateProductCommands(const ProductContext& ctx,
+ bool* is_valid);
static void ValidateProduct(const InstallationState& machine_state,
bool system_install,
const ProductState& product_state,

Powered by Google App Engine
This is Rietveld 408576698