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

Side by Side Diff: chrome/browser/ui/apps/apps_metro_handler_win.cc

Issue 1581473002: Remove base/win/metro.{cc|h} and some associated code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 11 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/apps/apps_metro_handler_win.h"
6
7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/apps/app_window_registry_util.h"
9 #include "chrome/browser/ui/simple_message_box.h"
10 #include "chrome/grit/chromium_strings.h"
11 #include "chrome/grit/generated_resources.h"
12 #include "extensions/browser/app_window/app_window.h"
13 #include "ui/base/l10n/l10n_util.h"
14
15 bool VerifyASHSwitchForApps(gfx::NativeWindow parent_window,
16 int win_restart_command_id) {
17 DCHECK(win_restart_command_id == IDC_WIN_DESKTOP_RESTART ||
18 win_restart_command_id == IDC_WIN8_METRO_RESTART ||
19 win_restart_command_id == IDC_WIN_CHROMEOS_RESTART);
20 if (!AppWindowRegistryUtil::IsAppWindowVisibleInAnyProfile(
21 extensions::AppWindow::WINDOW_TYPE_DEFAULT)) {
22 return true;
23 }
24
25 int string_id = 0;
26 switch (win_restart_command_id) {
27 case IDC_WIN8_METRO_RESTART:
28 string_id = IDS_WIN8_PROMPT_TO_CLOSE_APPS_FOR_METRO;
29 break;
30 case IDC_WIN_CHROMEOS_RESTART:
31 string_id = IDS_WIN_PROMPT_TO_CLOSE_APPS_FOR_CHROMEOS;
32 break;
33 default:
34 string_id = IDS_WIN_PROMPT_TO_CLOSE_APPS_FOR_DESKTOP;
35 break;
36 }
37 chrome::MessageBoxResult result = chrome::ShowMessageBox(
38 parent_window,
39 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
40 l10n_util::GetStringUTF16(string_id),
41 chrome::MESSAGE_BOX_TYPE_OK_CANCEL);
42
43 return result == chrome::MESSAGE_BOX_RESULT_YES;
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698