| Index: chrome/app/chrome_main.cc
|
| diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc
|
| index e24c4675287833e7a2654dccbe050ebe1dc89f10..cefe93b2e9bdf78db8f1739abaa27c1c6655e41e 100644
|
| --- a/chrome/app/chrome_main.cc
|
| +++ b/chrome/app/chrome_main.cc
|
| @@ -5,13 +5,15 @@
|
| #include <stdint.h>
|
|
|
| #include "build/build_config.h"
|
| +#include "base/command_line.h"
|
| #include "base/time/time.h"
|
| #include "chrome/app/chrome_main_delegate.h"
|
| #include "chrome/common/features.h"
|
| #include "content/public/app/content_main.h"
|
| +#include "content/public/common/content_switches.h"
|
| +#include "headless/app/headless_shell.h"
|
|
|
| #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
|
| -#include "base/command_line.h"
|
| #include "chrome/app/mash/mash_runner.h"
|
| #include "chrome/common/channel_info.h"
|
| #include "components/version_info/version_info.h"
|
| @@ -58,6 +60,11 @@ int ChromeMain(int argc, const char** argv) {
|
| #if defined(OS_WIN)
|
| install_static::InstallDetails::InitializeFromPrimaryModule(
|
| chrome::kChromeElfDllName);
|
| +
|
| + const base::CommandLine command_line(argc, argv);
|
| +#if defined(OS_LINUX)
|
| + if (command_line.HasSwitch(switches::kHeadless))
|
| + return HeadlessShellMain(argc, argv);
|
| #endif
|
|
|
| ChromeMainDelegate chrome_main_delegate(
|
| @@ -98,8 +105,6 @@ int ChromeMain(int argc, const char** argv) {
|
| version_info::Channel channel = chrome::GetChannel();
|
| if (channel == version_info::Channel::CANARY ||
|
| channel == version_info::Channel::UNKNOWN) {
|
| - const base::CommandLine& command_line =
|
| - *base::CommandLine::ForCurrentProcess();
|
| if (command_line.HasSwitch("mash"))
|
| return MashMain();
|
| }
|
|
|