Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "chrome/browser/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
| 6 | 6 |
| 7 #include "apps/app_shim/app_shim_mac.h" | 7 #include "apps/app_shim/app_shim_mac.h" |
| 8 #include "apps/app_shim/extension_app_shim_handler_mac.h" | 8 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
| 9 #include "apps/shell_window_registry.h" | 9 #include "apps/shell_window_registry.h" |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 // though.) http://crbug.com/40861 | 352 // though.) http://crbug.com/40861 |
| 353 | 353 |
| 354 // Check if the user really wants to quit by employing the confirm-to-quit | 354 // Check if the user really wants to quit by employing the confirm-to-quit |
| 355 // mechanism. | 355 // mechanism. |
| 356 if (!browser_shutdown::IsTryingToQuit() && | 356 if (!browser_shutdown::IsTryingToQuit() && |
| 357 [self applicationShouldTerminate:app] != NSTerminateNow) | 357 [self applicationShouldTerminate:app] != NSTerminateNow) |
| 358 return NO; | 358 return NO; |
| 359 | 359 |
| 360 size_t num_browsers = chrome::GetTotalBrowserCount(); | 360 size_t num_browsers = chrome::GetTotalBrowserCount(); |
| 361 | 361 |
| 362 // Initiate a shutdown (via chrome::CloseAllBrowsers()) if we aren't | 362 // Initiate a shutdown (via chrome::CloseAllBrowsersAndQuit()). |
| 363 // already shutting down. | 363 content::NotificationService::current()->Notify( |
| 364 if (!browser_shutdown::IsTryingToQuit()) { | 364 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
|
benwells
2013/10/21 05:57:22
Why was this check here? Or put another way, why h
Sam McNally
2013/10/21 06:45:35
Previously, CloseAllBrowsers called SetTryingToQui
benwells
2013/10/21 21:12:51
The check seems odd. I'm worried there an obscure
Sam McNally
2013/10/22 00:16:27
Done.
| |
| 365 content::NotificationService::current()->Notify( | 365 content::NotificationService::AllSources(), |
| 366 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 366 content::NotificationService::NoDetails()); |
| 367 content::NotificationService::AllSources(), | 367 chrome::CloseAllBrowsersAndQuit(); |
| 368 content::NotificationService::NoDetails()); | |
| 369 chrome::CloseAllBrowsers(); | |
| 370 } | |
| 371 | 368 |
| 372 return num_browsers == 0 ? YES : NO; | 369 return num_browsers == 0 ? YES : NO; |
| 373 } | 370 } |
| 374 | 371 |
| 375 - (void)stopTryingToTerminateApplication:(NSApplication*)app { | 372 - (void)stopTryingToTerminateApplication:(NSApplication*)app { |
| 376 if (browser_shutdown::IsTryingToQuit()) { | 373 if (browser_shutdown::IsTryingToQuit()) { |
| 377 // Reset the "trying to quit" state, so that closing all browser windows | 374 // Reset the "trying to quit" state, so that closing all browser windows |
| 378 // will no longer lead to termination. | 375 // will no longer lead to termination. |
| 379 browser_shutdown::SetTryingToQuit(false); | 376 browser_shutdown::SetTryingToQuit(false); |
| 380 | 377 |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1422 | 1419 |
| 1423 //--------------------------------------------------------------------------- | 1420 //--------------------------------------------------------------------------- |
| 1424 | 1421 |
| 1425 namespace app_controller_mac { | 1422 namespace app_controller_mac { |
| 1426 | 1423 |
| 1427 bool IsOpeningNewWindow() { | 1424 bool IsOpeningNewWindow() { |
| 1428 return g_is_opening_new_window; | 1425 return g_is_opening_new_window; |
| 1429 } | 1426 } |
| 1430 | 1427 |
| 1431 } // namespace app_controller_mac | 1428 } // namespace app_controller_mac |
| OLD | NEW |