| Index: chrome/browser/process_singleton_win.cc
|
| diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
|
| index 82f3d4f5739e2282e196bee5a2de038e8d696df6..bc1240d45a543aac5891d1b731c9fb508100f0a4 100644
|
| --- a/chrome/browser/process_singleton_win.cc
|
| +++ b/chrome/browser/process_singleton_win.cc
|
| @@ -195,6 +195,14 @@ bool ShouldLaunchInWindows8ImmersiveMode(const base::FilePath& user_data_dir) {
|
| return false;
|
| }
|
|
|
| +bool DisplayShouldKillMessageBox() {
|
| + return chrome::ShowMessageBox(
|
| + NULL, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
|
| + l10n_util::GetStringUTF16(IDS_BROWSER_HUNGBROWSER_MESSAGE),
|
| + chrome::MESSAGE_BOX_TYPE_QUESTION) !=
|
| + chrome::MESSAGE_BOX_RESULT_NO;
|
| +}
|
| +
|
| } // namespace
|
|
|
| // Microsoft's Softricity virtualization breaks the sandbox processes.
|
| @@ -232,8 +240,11 @@ ProcessSingleton::ProcessSingleton(
|
| const base::FilePath& user_data_dir,
|
| const NotificationCallback& notification_callback)
|
| : notification_callback_(notification_callback),
|
| - is_virtualized_(false), lock_file_(INVALID_HANDLE_VALUE),
|
| - user_data_dir_(user_data_dir) {
|
| + is_virtualized_(false),
|
| + lock_file_(INVALID_HANDLE_VALUE),
|
| + user_data_dir_(user_data_dir),
|
| + should_kill_remote_process_callback_(
|
| + base::Bind(&DisplayShouldKillMessageBox)) {
|
| }
|
|
|
| ProcessSingleton::~ProcessSingleton() {
|
| @@ -279,12 +290,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
|
| reinterpret_cast<LPARAM>(&visible_window));
|
|
|
| // If there is a visible browser window, ask the user before killing it.
|
| - if (visible_window &&
|
| - chrome::ShowMessageBox(
|
| - NULL,
|
| - l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
|
| - l10n_util::GetStringUTF16(IDS_BROWSER_HUNGBROWSER_MESSAGE),
|
| - chrome::MESSAGE_BOX_TYPE_QUESTION) == chrome::MESSAGE_BOX_RESULT_NO) {
|
| + if (visible_window && !should_kill_remote_process_callback_.Run()) {
|
| // The user denied. Quit silently.
|
| return PROCESS_NOTIFIED;
|
| }
|
| @@ -437,3 +443,8 @@ bool ProcessSingleton::Create() {
|
|
|
| void ProcessSingleton::Cleanup() {
|
| }
|
| +
|
| +void ProcessSingleton::OverrideShouldKillRemoteProcessCallbackForTesting(
|
| + const ShouldKillRemoteProcessCallback& display_dialog_callback) {
|
| + should_kill_remote_process_callback_ = display_dialog_callback;
|
| +}
|
|
|