| 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 // This file contains the penultimate pieces of the Mac shutdown puzzle. For | 5 // This file contains the penultimate pieces of the Mac shutdown puzzle. For |
| 6 // an in-depth overview of the Mac shutdown path, see the comment above | 6 // an in-depth overview of the Mac shutdown path, see the comment above |
| 7 // -[BrowserCrApplication terminate:]. | 7 // -[BrowserCrApplication terminate:]. |
| 8 | 8 |
| 9 #include "chrome/browser/lifetime/application_lifetime.h" | 9 #include "chrome/browser/lifetime/application_lifetime.h" |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "chrome/browser/browser_shutdown.h" | 12 #include "chrome/browser/browser_shutdown.h" |
| 13 #import "chrome/browser/chrome_browser_application_mac.h" | 13 #import "chrome/browser/chrome_browser_application_mac.h" |
| 14 | 14 |
| 15 namespace browser { | 15 namespace chrome { |
| 16 | 16 |
| 17 // At this point, the user is trying to quit (or the system is forcing the | 17 // At this point, the user is trying to quit (or the system is forcing the |
| 18 // application to quit) and all browsers have been successfully closed. The | 18 // application to quit) and all browsers have been successfully closed. The |
| 19 // final step in shutdown is to post the NSApplicationWillTerminateNotification | 19 // final step in shutdown is to post the NSApplicationWillTerminateNotification |
| 20 // to end the -[NSApplication run] event loop. | 20 // to end the -[NSApplication run] event loop. |
| 21 void HandleAppExitingForPlatform() { | 21 void HandleAppExitingForPlatform() { |
| 22 static bool kill_me_now = false; | 22 static bool kill_me_now = false; |
| 23 CHECK(!kill_me_now); | 23 CHECK(!kill_me_now); |
| 24 kill_me_now = true; | 24 kill_me_now = true; |
| 25 | 25 |
| 26 [[NSNotificationCenter defaultCenter] | 26 [[NSNotificationCenter defaultCenter] |
| 27 postNotificationName:NSApplicationWillTerminateNotification | 27 postNotificationName:NSApplicationWillTerminateNotification |
| 28 object:NSApp]; | 28 object:NSApp]; |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace browser | 31 } // namespace chrome |
| OLD | NEW |