| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_INSTALLER_UTIL_INSTALLATION_VALIDATOR_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_INSTALLATION_VALIDATOR_H_ |
| 6 #define CHROME_INSTALLER_UTIL_INSTALLATION_VALIDATOR_H_ | 6 #define CHROME_INSTALLER_UTIL_INSTALLATION_VALIDATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 InstallationType* type); | 76 InstallationType* type); |
| 77 | 77 |
| 78 protected: | 78 protected: |
| 79 typedef std::vector<std::pair<std::string, bool> > SwitchExpectations; | 79 typedef std::vector<std::pair<std::string, bool> > SwitchExpectations; |
| 80 | 80 |
| 81 // An interface to product-specific validation rules. | 81 // An interface to product-specific validation rules. |
| 82 class ProductRules { | 82 class ProductRules { |
| 83 public: | 83 public: |
| 84 virtual ~ProductRules() { } | 84 virtual ~ProductRules() { } |
| 85 virtual BrowserDistribution::Type distribution_type() const = 0; | 85 virtual BrowserDistribution::Type distribution_type() const = 0; |
| 86 virtual void AddUninstallSwitchExpectations( | 86 virtual void AddProductSwitchExpectations( |
| 87 const InstallationState& machine_state, | 87 const InstallationState& machine_state, |
| 88 bool system_install, | 88 bool system_install, |
| 89 const ProductState& product_state, | 89 const ProductState& product_state, |
| 90 SwitchExpectations* expectations) const = 0; | 90 SwitchExpectations* expectations) const = 0; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 // Validation rules for the Chrome browser. | 93 // Validation rules for the Chrome browser. |
| 94 class ChromeRules : public ProductRules { | 94 class ChromeRules : public ProductRules { |
| 95 public: | 95 public: |
| 96 virtual BrowserDistribution::Type distribution_type() const OVERRIDE; | 96 virtual BrowserDistribution::Type distribution_type() const OVERRIDE; |
| 97 virtual void AddUninstallSwitchExpectations( | 97 virtual void AddProductSwitchExpectations( |
| 98 const InstallationState& machine_state, | 98 const InstallationState& machine_state, |
| 99 bool system_install, | 99 bool system_install, |
| 100 const ProductState& product_state, | 100 const ProductState& product_state, |
| 101 SwitchExpectations* expectations) const OVERRIDE; | 101 SwitchExpectations* expectations) const OVERRIDE; |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // Validation rules for Chrome Frame. | 104 // Validation rules for Chrome Frame. |
| 105 class ChromeFrameRules : public ProductRules { | 105 class ChromeFrameRules : public ProductRules { |
| 106 public: | 106 public: |
| 107 virtual BrowserDistribution::Type distribution_type() const OVERRIDE; | 107 virtual BrowserDistribution::Type distribution_type() const OVERRIDE; |
| 108 virtual void AddUninstallSwitchExpectations( | 108 virtual void AddProductSwitchExpectations( |
| 109 const InstallationState& machine_state, | 109 const InstallationState& machine_state, |
| 110 bool system_install, | 110 bool system_install, |
| 111 const ProductState& product_state, | 111 const ProductState& product_state, |
| 112 SwitchExpectations* expectations) const OVERRIDE; | 112 SwitchExpectations* expectations) const OVERRIDE; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 struct ProductContext { | 115 struct ProductContext { |
| 116 const InstallationState& machine_state; | 116 const InstallationState& machine_state; |
| 117 bool system_install; | 117 bool system_install; |
| 118 BrowserDistribution* dist; | 118 BrowserDistribution* dist; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // A collection of all valid installation types. | 152 // A collection of all valid installation types. |
| 153 static const InstallationType kInstallationTypes[]; | 153 static const InstallationType kInstallationTypes[]; |
| 154 | 154 |
| 155 private: | 155 private: |
| 156 DISALLOW_IMPLICIT_CONSTRUCTORS(InstallationValidator); | 156 DISALLOW_IMPLICIT_CONSTRUCTORS(InstallationValidator); |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 } // namespace installer | 159 } // namespace installer |
| 160 | 160 |
| 161 #endif // CHROME_INSTALLER_UTIL_INSTALLATION_VALIDATOR_H_ | 161 #endif // CHROME_INSTALLER_UTIL_INSTALLATION_VALIDATOR_H_ |
| OLD | NEW |