Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 498573003: Add relaunch into ASH and desktop support for Chrome on Windows 7. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed newline from chrome_command_ids.h Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/ash_util.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 0f7e6686f5175be993aed998c468f78a260d8a94..f1967890e002fde9ca25a34037b44faa7ff73ed8 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -461,12 +461,6 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
#endif
break;
-#if defined(USE_ASH)
- case IDC_TOGGLE_ASH_DESKTOP:
- chrome::ToggleAshDesktop();
- break;
-#endif
-
#if defined(OS_CHROMEOS)
case IDC_VISIT_DESKTOP_OF_LRU_USER_2:
case IDC_VISIT_DESKTOP_OF_LRU_USER_3:
@@ -491,20 +485,29 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
case IDC_METRO_SNAP_DISABLE:
browser_->SetMetroSnapMode(false);
break;
- case IDC_WIN8_DESKTOP_RESTART:
- if (!VerifyMetroSwitchForApps(window()->GetNativeWindow(), id))
+ case IDC_WIN_DESKTOP_RESTART:
+ if (!VerifyASHSwitchForApps(window()->GetNativeWindow(), id))
break;
chrome::AttemptRestartToDesktopMode();
- content::RecordAction(base::UserMetricsAction("Win8DesktopRestart"));
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ content::RecordAction(base::UserMetricsAction("Win8DesktopRestart"));
+ } else {
+ content::RecordAction(base::UserMetricsAction("Win7DesktopRestart"));
+ }
break;
case IDC_WIN8_METRO_RESTART:
- if (!VerifyMetroSwitchForApps(window()->GetNativeWindow(), id))
+ case IDC_WIN_CHROMEOS_RESTART:
+ if (!VerifyASHSwitchForApps(window()->GetNativeWindow(), id))
break;
-
- // SwitchToMetroUIHandler deletes itself.
- new SwitchToMetroUIHandler;
- content::RecordAction(base::UserMetricsAction("Win8MetroRestart"));
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ // SwitchToMetroUIHandler deletes itself.
+ new SwitchToMetroUIHandler;
+ content::RecordAction(base::UserMetricsAction("Win8MetroRestart"));
+ } else {
+ content::RecordAction(base::UserMetricsAction("Win7ASHRestart"));
+ chrome::AttemptRestartToMetroMode();
+ }
break;
#endif
@@ -886,11 +889,6 @@ void BrowserCommandController::InitCommandState() {
command_updater_.UpdateCommandEnabled(IDC_EXIT, true);
#endif
command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true);
-#if defined(OS_WIN) && defined(USE_ASH) && !defined(NDEBUG)
- if (base::win::GetVersion() < base::win::VERSION_WIN8 &&
- chrome::HOST_DESKTOP_TYPE_NATIVE != chrome::HOST_DESKTOP_TYPE_ASH)
- command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true);
-#endif
#if defined(USE_ASH)
command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true);
#endif
@@ -1002,7 +1000,9 @@ void BrowserCommandController::InitCommandState() {
bool metro = browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH;
command_updater_.UpdateCommandEnabled(IDC_METRO_SNAP_ENABLE, metro);
command_updater_.UpdateCommandEnabled(IDC_METRO_SNAP_DISABLE, metro);
- int restart_mode = metro ? IDC_WIN8_DESKTOP_RESTART : IDC_WIN8_METRO_RESTART;
+ int restart_mode = metro ? IDC_WIN_DESKTOP_RESTART :
+ (base::win::GetVersion() >= base::win::VERSION_WIN8 ?
+ IDC_WIN8_METRO_RESTART : IDC_WIN_CHROMEOS_RESTART);
command_updater_.UpdateCommandEnabled(restart_mode, normal_window);
#endif
« no previous file with comments | « chrome/browser/ui/ash/ash_util.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698