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

Side by Side Diff: chrome/browser/ui/apps/apps_metro_handler_win.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: Changed menu strings to Chrome OS mode Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/apps/apps_metro_handler_win.h" 5 #include "chrome/browser/ui/apps/apps_metro_handler_win.h"
6 6
7 #include "apps/app_window.h" 7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/ui/simple_message_box.h" 10 #include "chrome/browser/ui/simple_message_box.h"
11 #include "grit/chromium_strings.h" 11 #include "grit/chromium_strings.h"
12 #include "grit/generated_resources.h" 12 #include "grit/generated_resources.h"
13 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
14 14
15 bool VerifyMetroSwitchForApps(gfx::NativeWindow parent_window, 15 bool VerifyASHSwitchForApps(gfx::NativeWindow parent_window,
16 int win8_restart_command_id) { 16 int win_restart_command_id) {
17 DCHECK(win8_restart_command_id == IDC_WIN8_DESKTOP_RESTART || 17 DCHECK(win_restart_command_id == IDC_WIN_DESKTOP_RESTART ||
18 win8_restart_command_id == IDC_WIN8_METRO_RESTART); 18 win_restart_command_id == IDC_WIN8_METRO_RESTART ||
19 win_restart_command_id == IDC_WIN_ASH_RESTART);
19 if (!apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile( 20 if (!apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(
20 apps::AppWindow::WINDOW_TYPE_DEFAULT)) { 21 apps::AppWindow::WINDOW_TYPE_DEFAULT)) {
21 return true; 22 return true;
22 } 23 }
23 24
24 int string_id = win8_restart_command_id == IDC_WIN8_METRO_RESTART ? 25 int string_id = 0;
25 IDS_WIN8_PROMPT_TO_CLOSE_APPS_FOR_METRO : 26 switch (win_restart_command_id) {
26 IDS_WIN8_PROMPT_TO_CLOSE_APPS_FOR_DESKTOP; 27 case IDC_WIN8_METRO_RESTART:
28 string_id = IDS_WIN8_PROMPT_TO_CLOSE_APPS_FOR_METRO;
29 break;
30 case IDC_WIN_ASH_RESTART:
31 string_id = IDS_WIN_PROMPT_TO_CLOSE_APPS_FOR_ASH;
32 break;
33 default:
34 string_id = IDS_WIN_PROMPT_TO_CLOSE_APPS_FOR_DESKTOP;
35 break;
36 }
27 chrome::MessageBoxResult result = chrome::ShowMessageBox( 37 chrome::MessageBoxResult result = chrome::ShowMessageBox(
28 parent_window, 38 parent_window,
29 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), 39 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
30 l10n_util::GetStringUTF16(string_id), 40 l10n_util::GetStringUTF16(string_id),
31 chrome::MESSAGE_BOX_TYPE_OK_CANCEL); 41 chrome::MESSAGE_BOX_TYPE_OK_CANCEL);
32 42
33 return result == chrome::MESSAGE_BOX_RESULT_YES; 43 return result == chrome::MESSAGE_BOX_RESULT_YES;
34 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698