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