Chromium Code Reviews| Index: chrome/browser/browser_shutdown.cc |
| diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc |
| index b81446a2df396e80890d92efd58908abc00cbeab..90ceca86154e980f6ed566d2e87b5517367323f4 100644 |
| --- a/chrome/browser/browser_shutdown.cc |
| +++ b/chrome/browser/browser_shutdown.cc |
| @@ -69,6 +69,10 @@ namespace { |
| // Whether the browser is trying to quit (e.g., Quit chosen from menu). |
| bool g_trying_to_quit = false; |
| +// If restarting and this is true then add the kNoStartupWindow switch to the |
| +// command line. |
| +bool g_should_restart_in_background = false; |
| + |
| Time* g_shutdown_started = nullptr; |
| ShutdownType g_shutdown_type = NOT_VALID; |
| int g_shutdown_num_processes; |
| @@ -239,6 +243,8 @@ void ShutdownPostThreadsStop(bool restart_last_session) { |
| else |
| new_cl->AppendSwitch(it.first); |
| } |
| + if (g_should_restart_in_background) |
|
sky
2016/05/18 19:23:06
Having a global is error prone. Can you make this
dgn
2016/06/20 17:45:19
Done. It made it a static class member in Backgrou
|
| + new_cl->AppendSwitch(switches::kNoStartupWindow); |
| #if defined(OS_POSIX) || defined(OS_WIN) |
| upgrade_util::RelaunchChromeBrowser(*new_cl.get()); |
| @@ -335,6 +341,10 @@ bool IsTryingToQuit() { |
| return g_trying_to_quit; |
| } |
| +void SetShouldRestartInBackground(bool should_restart_in_background) { |
| + g_should_restart_in_background = should_restart_in_background; |
| +} |
| + |
| void StartShutdownTracing() { |
| const base::CommandLine& command_line = |
| *base::CommandLine::ForCurrentProcess(); |