forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[win8] Show a prompt before relaunching Chrome in Windows 8 mode whil…
…e packaged apps are running. Introduces ShellWindowRegistry::IsShellWindowRegisteredInAnyProfile to help determine if packaged apps are currently running. Intercepts the IDC_WIN8_METRO_RESTART command and shows a modal dialog box if packaged apps are running to confirm that the user is OK with their packaged apps closing. Ensures apps with a relaunch handler are not relaunched when restarting in metro mode. BUG=222297 TEST=Launch a packaged app in desktop mode and select 'Relaunch Chrome in Windows 8 mode' from the hotdog menu. A prompt should appear confirming that your Chrome apps will close if you continue. If no packaged apps are running, no prompt should appear. Review URL: https://chromiumcodereview.appspot.com/12566039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192240 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
tapted@chromium.org
committed
Apr 4, 2013
1 parent
bda506c
commit 24ced7d
Showing
16 changed files
with
176 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/ui/extensions/apps_metro_handler_win.h" | ||
|
||
#include "chrome/browser/extensions/shell_window_registry.h" | ||
#include "chrome/browser/ui/extensions/shell_window.h" | ||
#include "chrome/browser/ui/simple_message_box.h" | ||
#include "grit/chromium_strings.h" | ||
#include "grit/generated_resources.h" | ||
#include "ui/base/l10n/l10n_util.h" | ||
|
||
namespace chrome { | ||
|
||
bool VerifySwitchToMetroForApps(gfx::NativeWindow parent_window) { | ||
if (!extensions::ShellWindowRegistry::IsShellWindowRegisteredInAnyProfile( | ||
ShellWindow::WINDOW_TYPE_DEFAULT)) { | ||
return true; | ||
} | ||
|
||
MessageBoxResult result = ShowMessageBox( | ||
parent_window, | ||
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | ||
l10n_util::GetStringUTF16(IDS_WIN8_PROMPT_TO_CLOSE_APPS_FOR_METRO), | ||
MESSAGE_BOX_TYPE_OK_CANCEL); | ||
|
||
return result == MESSAGE_BOX_RESULT_YES; | ||
} | ||
|
||
} // namespace chrome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_UI_EXTENSIONS_APPS_METRO_HANDLER_WIN_H_ | ||
#define CHROME_BROWSER_UI_EXTENSIONS_APPS_METRO_HANDLER_WIN_H_ | ||
|
||
#include "ui/gfx/native_widget_types.h" | ||
|
||
namespace chrome { | ||
|
||
// Check if there are apps running and if not, return true. Otherwise, Show a | ||
// modal dialog on |parent| asking whether the user is OK with their packaged | ||
// apps closing, in order to relaunch to metro mode. Returns true if the user | ||
// clicks OK. | ||
bool VerifySwitchToMetroForApps(gfx::NativeWindow parent); | ||
|
||
} // namespace chrome | ||
|
||
#endif // CHROME_BROWSER_UI_EXTENSIONS_APPS_METRO_HANDLER_WIN_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters