summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser_command_controller.cc
diff options
context:
space:
mode:
authortapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 08:50:37 +0000
committertapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 08:50:37 +0000
commit396de687036fb8d01a2b78fb950b2f79226f01f7 (patch)
treeb5a38d1336cc63a1877811ab184828df6b0d44fa /chrome/browser/ui/browser_command_controller.cc
parent29892bcddf2e1232b0ecf4a86ee80d9ceceea146 (diff)
downloadchromium_src-396de687036fb8d01a2b78fb950b2f79226f01f7.zip
chromium_src-396de687036fb8d01a2b78fb950b2f79226f01f7.tar.gz
chromium_src-396de687036fb8d01a2b78fb950b2f79226f01f7.tar.bz2
[win8] Confirm switching Metro->Desktop when Chrome Apps are running.
There is already a dialog presented to the user when switching from Desktop to Metro when Apps are running. Since Apps can now run when Chrome is in Metro mode (and switching modes is a process relaunch since r232120), Apps can also be killed switching Metro->Desktop which may result in data loss. This CL adds UI when the user has Chrome Apps running (either in Ash or in Desktop) and selects "Restart Chrome in Desktop Mode" from a Metro-Mode browser window's tools menu, running in Ash. It says "Relaunching in Desktop mode will close your Chrome apps" [OK] [Cancel]. BUG=314861 TEST=Open Chrome in Metro mode and launch a Chrome App (e.g. Google Keep) from the app launcher. Try to restart Chrome in Desktop mode - dialog above should show. There should be no dialog with no apps running, Review URL: https://codereview.chromium.org/63723002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_command_controller.cc')
-rw-r--r--chrome/browser/ui/browser_command_controller.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 7d5a24d..2704f1d 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -487,11 +487,14 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
browser_->SetMetroSnapMode(false);
break;
case IDC_WIN8_DESKTOP_RESTART:
+ if (!VerifyMetroSwitchForApps(window()->GetNativeWindow(), id))
+ break;
+
chrome::AttemptRestartToDesktopMode();
content::RecordAction(content::UserMetricsAction("Win8DesktopRestart"));
break;
case IDC_WIN8_METRO_RESTART:
- if (!VerifySwitchToMetroForApps(window()->GetNativeWindow()))
+ if (!VerifyMetroSwitchForApps(window()->GetNativeWindow(), id))
break;
// SwitchToMetroUIHandler deletes itself.