| Index: chrome/browser/browser_shutdown.cc
|
| ===================================================================
|
| --- chrome/browser/browser_shutdown.cc (revision 155242)
|
| +++ chrome/browser/browser_shutdown.cc (working copy)
|
| @@ -65,6 +65,12 @@
|
| // Whether the browser should quit without closing browsers.
|
| bool g_shutting_down_without_closing_browsers = false;
|
|
|
| +#if defined(OS_WIN)
|
| +// Whether the next restart should happen in the opposite mode; desktop or
|
| +// metro mode. Windows 8 only.
|
| +bool g_mode_switch = false;
|
| +#endif
|
| +
|
| Time* shutdown_started_ = NULL;
|
| ShutdownType shutdown_type_ = NOT_VALID;
|
| int shutdown_num_processes_;
|
| @@ -147,6 +153,14 @@
|
| restart_last_session =
|
| prefs->GetBoolean(prefs::kRestartLastSessionOnShutdown);
|
| prefs->ClearPref(prefs::kRestartLastSessionOnShutdown);
|
| +#if defined(OS_WIN)
|
| + if (restart_last_session) {
|
| + if (prefs->HasPrefPath(prefs::kRestartSwitchMode)) {
|
| + g_mode_switch = prefs->GetBoolean(prefs::kRestartSwitchMode);
|
| + prefs->SetBoolean(prefs::kRestartSwitchMode, false);
|
| + }
|
| + }
|
| +#endif
|
| }
|
|
|
| prefs->CommitPendingWrite();
|
| @@ -210,7 +224,17 @@
|
| else
|
| new_cl->AppendSwitch(i->first);
|
| }
|
| +
|
| +#if defined(OS_WIN)
|
| + // On Windows 8 we can relaunch in metro or desktop mode.
|
| + if (g_mode_switch)
|
| + upgrade_util::RelaunchChromeWithModeSwitch(*new_cl.get());
|
| + else
|
| + upgrade_util::RelaunchChromeBrowser(*new_cl.get());
|
| +#else
|
| upgrade_util::RelaunchChromeBrowser(*new_cl.get());
|
| +#endif // defined(OS_WIN)
|
| +
|
| #else
|
| NOTIMPLEMENTED();
|
| #endif // !defined(OS_CHROMEOS)
|
|
|