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 // 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 bool* is_valid) { | 383 bool* is_valid) { |
384 for (SwitchExpectations::size_type i = 0, size = expected.size(); i < size; | 384 for (SwitchExpectations::size_type i = 0, size = expected.size(); i < size; |
385 ++i) { | 385 ++i) { |
386 const SwitchExpectations::value_type& expectation = expected[i]; | 386 const SwitchExpectations::value_type& expectation = expected[i]; |
387 if (command.HasSwitch(expectation.first) != expectation.second) { | 387 if (command.HasSwitch(expectation.first) != expectation.second) { |
388 *is_valid = false; | 388 *is_valid = false; |
389 LOG(ERROR) << ctx.dist->GetAppShortCutName() << " " << source | 389 LOG(ERROR) << ctx.dist->GetAppShortCutName() << " " << source |
390 << (expectation.second ? " is missing" : " has") << " \"" | 390 << (expectation.second ? " is missing" : " has") << " \"" |
391 << expectation.first << "\"" | 391 << expectation.first << "\"" |
392 << (expectation.second ? "" : " but shouldn't") << ": " | 392 << (expectation.second ? "" : " but shouldn't") << ": " |
393 << command.command_line_string(); | 393 << command.GetCommandLineString(); |
394 } | 394 } |
395 } | 395 } |
396 } | 396 } |
397 | 397 |
398 // Validates that |command|, originating from |source|, is formed properly for | 398 // Validates that |command|, originating from |source|, is formed properly for |
399 // the product described by |ctx| | 399 // the product described by |ctx| |
400 void InstallationValidator::ValidateUninstallCommand(const ProductContext& ctx, | 400 void InstallationValidator::ValidateUninstallCommand(const ProductContext& ctx, |
401 const CommandLine& command, | 401 const CommandLine& command, |
402 const char* source, | 402 const char* source, |
403 bool* is_valid) { | 403 bool* is_valid) { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 InstallationType* type) { | 623 InstallationType* type) { |
624 DCHECK(type); | 624 DCHECK(type); |
625 InstallationState machine_state; | 625 InstallationState machine_state; |
626 | 626 |
627 machine_state.Initialize(); | 627 machine_state.Initialize(); |
628 | 628 |
629 return ValidateInstallationTypeForState(machine_state, system_level, type); | 629 return ValidateInstallationTypeForState(machine_state, system_level, type); |
630 } | 630 } |
631 | 631 |
632 } // namespace installer | 632 } // namespace installer |
OLD | NEW |