| 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()) if we aren't |
| 363 // already shutting down. | 363 // already shutting down. |
| 364 if (!browser_shutdown::IsTryingToQuit()) { | 364 if (!browser_shutdown::IsTryingToQuit()) { |
| 365 content::NotificationService::current()->Notify( | 365 content::NotificationService::current()->Notify( |
| 366 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 366 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 367 content::NotificationService::AllSources(), | 367 content::NotificationService::AllSources(), |
| 368 content::NotificationService::NoDetails()); | 368 content::NotificationService::NoDetails()); |
| 369 chrome::CloseAllBrowsers(); | 369 chrome::CloseAllBrowsersAndQuit(); |
| 370 } | 370 } |
| 371 | 371 |
| 372 return num_browsers == 0 ? YES : NO; | 372 return num_browsers == 0 ? YES : NO; |
| 373 } | 373 } |
| 374 | 374 |
| 375 - (void)stopTryingToTerminateApplication:(NSApplication*)app { | 375 - (void)stopTryingToTerminateApplication:(NSApplication*)app { |
| 376 if (browser_shutdown::IsTryingToQuit()) { | 376 if (browser_shutdown::IsTryingToQuit()) { |
| 377 // Reset the "trying to quit" state, so that closing all browser windows | 377 // Reset the "trying to quit" state, so that closing all browser windows |
| 378 // will no longer lead to termination. | 378 // will no longer lead to termination. |
| 379 browser_shutdown::SetTryingToQuit(false); | 379 browser_shutdown::SetTryingToQuit(false); |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1423 | 1423 |
| 1424 //--------------------------------------------------------------------------- | 1424 //--------------------------------------------------------------------------- |
| 1425 | 1425 |
| 1426 namespace app_controller_mac { | 1426 namespace app_controller_mac { |
| 1427 | 1427 |
| 1428 bool IsOpeningNewWindow() { | 1428 bool IsOpeningNewWindow() { |
| 1429 return g_is_opening_new_window; | 1429 return g_is_opening_new_window; |
| 1430 } | 1430 } |
| 1431 | 1431 |
| 1432 } // namespace app_controller_mac | 1432 } // namespace app_controller_mac |
| OLD | NEW |