Commit 789ee677 authored by Erik Chen's avatar Erik Chen Committed by Commit Bot

Add a run-time switch for lacros-chrome-path.

Setting the switch will cause ash-chrome to launch the lacros-chrome
binary from the given path rather than from component updater.

Bug: 1077348
Change-Id: I50f5a1be84c31df434b37997007112e7c1296767
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2200078
Commit-Queue: Erik Chen <erikchen@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Auto-Submit: Erik Chen <erikchen@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768532}
parent 7fd75093
......@@ -69,6 +69,17 @@ void LacrosLoader::Init() {
if (chromeos::features::IsLacrosSupportEnabled()) {
// TODO(crbug.com/1078607): Remove non-error logging from this class.
LOG(WARNING) << "Starting lacros component load.";
// If the user has specified a path for the lacros-chrome binary, use that
// rather than component manager.
base::FilePath lacros_chrome_path =
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
chromeos::switches::kLacrosChromePath);
if (!lacros_chrome_path.empty()) {
OnLoadComplete(CrOSComponentManager::Error::NONE, lacros_chrome_path);
return;
}
cros_component_manager_->Load(kLacrosComponentName,
CrOSComponentManager::MountPolicy::kMount,
CrOSComponentManager::UpdatePolicy::kForce,
......
......@@ -396,6 +396,11 @@ const char kIgnoreUserProfileMappingForTests[] =
// chrome://flags
const char kKernelnextRestrictVMs[] = "kernelnext-restrict-vms";
// If this switch is set, then ash-chrome will exec the lacros-chrome binary
// from the indicated path rather than from component updater. Note that the
// path should be to a directory that contains a binary named 'chrome'.
const char kLacrosChromePath[] = "lacros-chrome-path";
// Enables Chrome-as-a-login-manager behavior.
const char kLoginManager[] = "login-manager";
......
......@@ -161,6 +161,7 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kHomedir[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kIgnoreUserProfileMappingForTests[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kKernelnextRestrictVMs[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kLacrosChromePath[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kLoginManager[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kLoginProfile[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kLoginUser[];
......
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