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

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

Issue 612093007: Remove kCmdInstallExtension and kCmdInstallApp from Installer code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 ce18722bc2b727c956718fa7fdafdb364bd682e0..6a982b8fc144a10395f36f1c51e407af45e12e82 100644
--- a/chrome/installer/util/installation_validator.cc
+++ b/chrome/installer/util/installation_validator.cc
@@ -201,64 +201,6 @@ void InstallationValidator::ValidateAppCommandFlags(
}
}
-// Validates both "install-application" and "install-extension" depending on
-// what is passed in.
-void InstallationValidator::ValidateInstallCommand(
- const ProductContext& ctx,
- const AppCommand& app_cmd,
- const wchar_t* expected_command,
- const wchar_t* expected_app_name,
- const char* expected_switch,
- bool* is_valid) {
- DCHECK(is_valid);
-
- CommandLine cmd_line(CommandLine::FromString(app_cmd.command_line()));
- base::string16 name(expected_command);
-
- base::FilePath expected_path(
- installer::GetChromeInstallPath(ctx.system_install, ctx.dist)
- .Append(expected_app_name));
-
- if (!base::FilePath::CompareEqualIgnoreCase(expected_path.value(),
- cmd_line.GetProgram().value())) {
- *is_valid = false;
- LOG(ERROR) << name << "'s path is not "
- << expected_path.value() << ": "
- << cmd_line.GetProgram().value();
- }
-
- SwitchExpectations expected;
- expected.push_back(std::make_pair(std::string(expected_switch), true));
-
- ValidateCommandExpectations(ctx, cmd_line, expected, name, is_valid);
-
- std::set<base::string16> flags_exp;
- flags_exp.insert(google_update::kRegSendsPingsField);
- flags_exp.insert(google_update::kRegWebAccessibleField);
- flags_exp.insert(google_update::kRegRunAsUserField);
- ValidateAppCommandFlags(ctx, app_cmd, flags_exp, name, is_valid);
-}
-
-// Validates the "install-application" Google Update product command.
-void InstallationValidator::ValidateInstallAppCommand(
- const ProductContext& ctx,
- const AppCommand& app_cmd,
- bool* is_valid) {
- ValidateInstallCommand(ctx, app_cmd, kCmdInstallApp,
- installer::kChromeAppHostExe,
- ::switches::kInstallFromWebstore, is_valid);
-}
-
-// Validates the "install-extension" Google Update product command.
-void InstallationValidator::ValidateInstallExtensionCommand(
- const ProductContext& ctx,
- const AppCommand& app_cmd,
- bool* is_valid) {
- ValidateInstallCommand(ctx, app_cmd, kCmdInstallExtension,
- installer::kChromeExe,
- ::switches::kLimitedInstallFromWebstore, is_valid);
-}
-
// Validates the "on-os-upgrade" Google Update internal command.
void InstallationValidator::ValidateOnOsUpgradeCommand(
const ProductContext& ctx,
@@ -686,13 +628,8 @@ void InstallationValidator::ValidateAppCommands(
CommandExpectations expectations;
- if (ctx.dist->GetType() == BrowserDistribution::CHROME_APP_HOST) {
- expectations[kCmdInstallApp] = &ValidateInstallAppCommand;
- }
- if (ctx.dist->GetType() == BrowserDistribution::CHROME_BROWSER) {
- expectations[kCmdInstallExtension] = &ValidateInstallExtensionCommand;
+ if (ctx.dist->GetType() == BrowserDistribution::CHROME_BROWSER)
expectations[kCmdOnOsUpgrade] = &ValidateOnOsUpgradeCommand;
- }
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