Problem:
Three different codepaths exist for triggering a browser restart, from different
parts of the UI.
1 SystemHandler::HandleRestartBrowser delegates to chrome::AttemptRestart(),
but also does some additional work for Windows only (see Windows-only big
comment about not accidentally reporting crashes).
2 LanguagesHandler::HandleRestart, delegates to chrome::AttemptRestart() on
non-CrOS, and to chrome::AttemptUserExit() on CrOS.
3 AboutHandler::HandleRelaunchNow, delegates to VersionUpdater::RelaunchBrowser
which delegates to chrome::AttemptRestart() on all non-CrOS platforms and to
DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
on ChromeOS.
Refactoring plan.
1 Create a dedicated C++ handler for "relaunch" and "factory reset", called
BrowserLifetimeHandler.
2 Create a corresponding JS LifetimeBrowserPorxy that talks to the new C++
handler.
3 Update all JS pages mentioned above to use the new browser proxy to trigger
"relaunch" and "reset".
4 Remove obsolete code from all C++ handlers and corresponding browser proxies
mentioned in previous paragraph.
"Factory reset" functionality will also be rolled into the new C++ handler after
the above refactoring has been completed.
Comment 1 by bugdroid1@chromium.org
, Jun 7 2016