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

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

Issue 12035043: Implementing app command to query EULA acceptance state for Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style and string fixes. Created 7 years, 11 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.cc
diff --git a/chrome/installer/util/installation_validator.cc b/chrome/installer/util/installation_validator.cc
index 23740eb86f62afcaf3fc2045af3668bb4c1aafdd..53c82374fa0c5b5b78e92ef50324968e0edeca29 100644
--- a/chrome/installer/util/installation_validator.cc
+++ b/chrome/installer/util/installation_validator.cc
@@ -270,6 +270,39 @@ void InstallationValidator::ValidateOnOsUpgradeCommand(
}
}
+// Validates the "query-eula-acceptance" Google Update product command.
+void InstallationValidator::ValidateQueryEULAAcceptanceCommand(
+ const ProductContext& ctx,
+ const AppCommand& command,
+ bool* is_valid) {
+ DCHECK(is_valid);
+
+ CommandLine the_command(CommandLine::FromString(command.command_line()));
+
+ ValidateSetupPath(ctx, the_command.GetProgram(), "query EULA acceptance",
+ is_valid);
+
+ SwitchExpectations expected;
+ expected.push_back(std::make_pair(std::string(switches::kQueryEULAAcceptance),
+ true));
+ expected.push_back(std::make_pair(std::string(switches::kSystemLevel),
+ ctx.system_install));
+
+ ValidateCommandExpectations(ctx, the_command, expected,
+ "query EULA acceptance", is_valid);
+
+ if (command.sends_pings()) {
+ *is_valid = false;
+ LOG(ERROR) << "Query-EULA-acceptance command "
+ "should not be able to send pings.";
+ }
+
+ if (!command.is_web_accessible()) {
+ *is_valid = false;
+ LOG(ERROR) << "Query-EULA-acceptance command is not web accessible.";
+ }
+}
+
// Validates the "quick-enable-cf" Google Update product command.
void InstallationValidator::ValidateQuickEnableCfCommand(
const ProductContext& ctx,
@@ -410,6 +443,8 @@ void InstallationValidator::ValidateBinariesCommands(
expectations[kCmdQuickEnableApplicationHost] =
&ValidateQuickEnableApplicationHostCommand;
+
+ expectations[kCmdQueryEULAAcceptance] = &ValidateQueryEULAAcceptanceCommand;
}
ValidateAppCommandExpectations(ctx, expectations, is_valid);
« no previous file with comments | « chrome/installer/util/installation_validator.h ('k') | chrome/installer/util/installation_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698