OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROME_BROWSER_APPLICATION_MAC_H_ | 5 #ifndef CHROME_BROWSER_CHROME_BROWSER_APPLICATION_MAC_H_ |
6 #define CHROME_BROWSER_CHROME_BROWSER_APPLICATION_MAC_H_ | 6 #define CHROME_BROWSER_CHROME_BROWSER_APPLICATION_MAC_H_ |
7 | 7 |
8 #ifdef __OBJC__ | 8 #ifdef __OBJC__ |
9 | 9 |
10 #import "base/chrome_application_mac.h" | 10 #import "base/chrome_application_mac.h" |
11 | 11 |
12 @interface BrowserCrApplication : CrApplication | 12 @interface BrowserCrApplication : CrApplication |
| 13 // Our implementation of |-terminate:| only attempts to terminate the |
| 14 // application, i.e., begins a process which may lead to termination. This |
| 15 // method cancels that process. |
| 16 - (void)cancelTerminate:(id)sender; |
13 @end | 17 @end |
14 | 18 |
15 namespace chrome_browser_application_mac { | 19 namespace chrome_browser_application_mac { |
16 | 20 |
17 // Bin for unknown exceptions. Exposed for testing purposes. | 21 // Bin for unknown exceptions. Exposed for testing purposes. |
18 extern const size_t kUnknownNSException; | 22 extern const size_t kUnknownNSException; |
19 | 23 |
20 // Returns the histogram bin for |exception| if it is one we track | 24 // Returns the histogram bin for |exception| if it is one we track |
21 // specifically, or |kUnknownNSException| if unknown. Exposed for testing | 25 // specifically, or |kUnknownNSException| if unknown. Exposed for testing |
22 // purposes. | 26 // purposes. |
23 size_t BinForException(NSException* exception); | 27 size_t BinForException(NSException* exception); |
24 | 28 |
25 // Use UMA to track exception occurance. Exposed for testing purposes. | 29 // Use UMA to track exception occurance. Exposed for testing purposes. |
26 void RecordExceptionWithUma(NSException* exception); | 30 void RecordExceptionWithUma(NSException* exception); |
27 | 31 |
28 } // namespace chrome_browser_application_mac | 32 } // namespace chrome_browser_application_mac |
29 | 33 |
30 #endif // __OBJC__ | 34 #endif // __OBJC__ |
31 | 35 |
32 namespace chrome_browser_application_mac { | 36 namespace chrome_browser_application_mac { |
33 | 37 |
34 // Calls -[NSApp terminate:]. | 38 // Calls -[NSApp terminate:]. |
35 void Terminate(); | 39 void Terminate(); |
36 | 40 |
| 41 // Cancels a termination started by |Terminate()|. |
| 42 void CancelTerminate(); |
| 43 |
37 } // namespace chrome_browser_application_mac | 44 } // namespace chrome_browser_application_mac |
38 | 45 |
39 #endif // CHROME_BROWSER_CHROME_BROWSER_APPLICATION_MAC_H_ | 46 #endif // CHROME_BROWSER_CHROME_BROWSER_APPLICATION_MAC_H_ |
OLD | NEW |