| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Implementation of the installation validator. | 5 // Implementation of the installation validator. |
| 6 | 6 |
| 7 #include "chrome/installer/util/installation_validator.h" | 7 #include "chrome/installer/util/installation_validator.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return BrowserDistribution::CHROME_APP_HOST; | 118 return BrowserDistribution::CHROME_APP_HOST; |
| 119 } | 119 } |
| 120 | 120 |
| 121 void InstallationValidator::ChromeAppHostRules::AddUninstallSwitchExpectations( | 121 void InstallationValidator::ChromeAppHostRules::AddUninstallSwitchExpectations( |
| 122 const InstallationState& machine_state, | 122 const InstallationState& machine_state, |
| 123 bool system_install, | 123 bool system_install, |
| 124 const ProductState& product_state, | 124 const ProductState& product_state, |
| 125 SwitchExpectations* expectations) const { | 125 SwitchExpectations* expectations) const { |
| 126 DCHECK(!system_install); | 126 DCHECK(!system_install); |
| 127 | 127 |
| 128 // --chrome-app-host must be present. | 128 // --app-host must be present. |
| 129 expectations->push_back(std::make_pair(std::string(switches::kChromeAppHost), | 129 expectations->push_back(std::make_pair(std::string(switches::kChromeAppHost), |
| 130 true)); | 130 true)); |
| 131 // --chrome must not be present. | 131 // --chrome must not be present. |
| 132 expectations->push_back(std::make_pair(std::string(switches::kChrome), | 132 expectations->push_back(std::make_pair(std::string(switches::kChrome), |
| 133 false)); | 133 false)); |
| 134 | 134 |
| 135 // --chrome-frame must not be present. | 135 // --chrome-frame must not be present. |
| 136 expectations->push_back(std::make_pair(std::string(switches::kChromeFrame), | 136 expectations->push_back(std::make_pair(std::string(switches::kChromeFrame), |
| 137 false)); | 137 false)); |
| 138 } | 138 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 CommandLine the_command(CommandLine::FromString(command.command_line())); | 326 CommandLine the_command(CommandLine::FromString(command.command_line())); |
| 327 | 327 |
| 328 ValidateSetupPath(ctx, | 328 ValidateSetupPath(ctx, |
| 329 the_command.GetProgram(), | 329 the_command.GetProgram(), |
| 330 "quick enable application host", | 330 "quick enable application host", |
| 331 is_valid); | 331 is_valid); |
| 332 | 332 |
| 333 SwitchExpectations expected; | 333 SwitchExpectations expected; |
| 334 | 334 |
| 335 expected.push_back( | 335 expected.push_back(std::make_pair( |
| 336 std::make_pair(std::string(switches::kChromeAppHost), true)); | 336 std::string(switches::kChromeAppHost), true)); |
| 337 expected.push_back(std::make_pair(std::string(switches::kSystemLevel), | 337 expected.push_back(std::make_pair( |
| 338 false)); | 338 std::string(switches::kSystemLevel), false)); |
| 339 expected.push_back(std::make_pair(std::string(switches::kMultiInstall), | 339 expected.push_back(std::make_pair( |
| 340 true)); | 340 std::string(switches::kMultiInstall), true)); |
| 341 expected.push_back(std::make_pair( |
| 342 std::string(switches::kEnsureGoogleUpdateInstalled), true)); |
| 341 | 343 |
| 342 ValidateCommandExpectations(ctx, | 344 ValidateCommandExpectations(ctx, |
| 343 the_command, | 345 the_command, |
| 344 expected, | 346 expected, |
| 345 "quick enable application host", | 347 "quick enable application host", |
| 346 is_valid); | 348 is_valid); |
| 347 | 349 |
| 348 if (!command.sends_pings()) { | 350 if (!command.sends_pings()) { |
| 349 *is_valid = false; | 351 *is_valid = false; |
| 350 LOG(ERROR) << "Quick-enable-application-host command is not configured to " | 352 LOG(ERROR) << "Quick-enable-application-host command is not configured to " |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 InstallationType* type) { | 858 InstallationType* type) { |
| 857 DCHECK(type); | 859 DCHECK(type); |
| 858 InstallationState machine_state; | 860 InstallationState machine_state; |
| 859 | 861 |
| 860 machine_state.Initialize(); | 862 machine_state.Initialize(); |
| 861 | 863 |
| 862 return ValidateInstallationTypeForState(machine_state, system_level, type); | 864 return ValidateInstallationTypeForState(machine_state, system_level, type); |
| 863 } | 865 } |
| 864 | 866 |
| 865 } // namespace installer | 867 } // namespace installer |
| OLD | NEW |