Commit 64aca4f6 authored by S. Ganesh's avatar S. Ganesh Committed by Commit Bot

Add an --appid= command line parameter to the Updater.

Using --install without using --appid={appid} will now install the
updater without installing any application.

Bug: 1014298
Change-Id: I4f6be0f5188261e75293abb6c939dd759fd01000
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121455
Commit-Queue: S. Ganesh <ganesh@chromium.org>
Reviewed-by: default avatarSorin Jianu <sorin@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Auto-Submit: S. Ganesh <ganesh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753749}
parent be01fca7
......@@ -25,6 +25,7 @@ const char kNoRateLimitSwitch[] = "no-rate-limit";
const char kEnableLoggingSwitch[] = "enable-logging";
const char kLoggingModuleSwitch[] = "vmodule";
const char kSingleProcessSwitch[] = "single-process";
const char kAppIdSwitch[] = "appid";
// URLs.
const char kUpdaterJSONDefaultUrl[] =
......
......@@ -86,6 +86,9 @@ extern const char kLoggingModuleSwitch[];
// only and it may be removed at any time.
extern const char kSingleProcessSwitch[];
// Specifies the application that the Updater needs to install.
extern const char kAppIdSwitch[];
// URLs.
//
// Omaha server end point.
......
......@@ -706,10 +706,6 @@ class AppInstall : public App {
void SetupDone(int result);
// TODO(sorin): remove the hardcoding of the application id.
// https://crbug.com/1014298
const std::string app_id_ = {kChromeAppId};
scoped_refptr<Configurator> config_;
scoped_refptr<InstallAppController> app_install_controller_;
......@@ -747,7 +743,9 @@ void AppInstall::FirstTaskRun() {
}
void AppInstall::SetupDone(int result) {
if (result != 0) {
const auto app_id =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(kAppIdSwitch);
if (result != 0 || app_id.empty()) {
Shutdown(result);
return;
}
......@@ -757,7 +755,7 @@ void AppInstall::SetupDone(int result) {
app_install_controller_ = base::MakeRefCounted<InstallAppController>(config_);
app_install_controller_->InstallApp(
app_id_, base::BindOnce(&AppInstall::Shutdown, this));
app_id, base::BindOnce(&AppInstall::Shutdown, this));
}
scoped_refptr<App> AppInstallInstance() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment