OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/common/chrome_application_mac.h" | 11 #import <AppKit/AppKit.h> |
| 12 |
| 13 #import "base/mac/scoped_sending_event.h" |
| 14 #import "base/memory/scoped_nsobject.h" |
| 15 #import "base/message_pump_mac.h" |
12 | 16 |
13 // Event hooks must implement this protocol. | 17 // Event hooks must implement this protocol. |
14 @protocol CrApplicationEventHookProtocol | 18 @protocol CrApplicationEventHookProtocol |
15 - (void)hookForEvent:(NSEvent*)theEvent; | 19 - (void)hookForEvent:(NSEvent*)theEvent; |
16 @end | 20 @end |
17 | 21 |
18 @interface BrowserCrApplication : CrApplication { | 22 @interface BrowserCrApplication : NSApplication<CrAppProtocol, |
| 23 CrAppControlProtocol> { |
19 @private | 24 @private |
| 25 BOOL handlingSendEvent_; |
| 26 |
20 // Array of objects implementing CrApplicationEventHookProtocol. | 27 // Array of objects implementing CrApplicationEventHookProtocol. |
21 scoped_nsobject<NSMutableArray> eventHooks_; | 28 scoped_nsobject<NSMutableArray> eventHooks_; |
22 } | 29 } |
23 | 30 |
24 // Our implementation of |-terminate:| only attempts to terminate the | 31 // Our implementation of |-terminate:| only attempts to terminate the |
25 // application, i.e., begins a process which may lead to termination. This | 32 // application, i.e., begins a process which may lead to termination. This |
26 // method cancels that process. | 33 // method cancels that process. |
27 - (void)cancelTerminate:(id)sender; | 34 - (void)cancelTerminate:(id)sender; |
28 | 35 |
29 // Add or remove an event hook to be called for every sendEvent: | 36 // Add or remove an event hook to be called for every sendEvent: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 69 |
63 // Calls -[NSApp terminate:]. | 70 // Calls -[NSApp terminate:]. |
64 void Terminate(); | 71 void Terminate(); |
65 | 72 |
66 // Cancels a termination started by |Terminate()|. | 73 // Cancels a termination started by |Terminate()|. |
67 void CancelTerminate(); | 74 void CancelTerminate(); |
68 | 75 |
69 } // namespace chrome_browser_application_mac | 76 } // namespace chrome_browser_application_mac |
70 | 77 |
71 #endif // CHROME_BROWSER_CHROME_BROWSER_APPLICATION_MAC_H_ | 78 #endif // CHROME_BROWSER_CHROME_BROWSER_APPLICATION_MAC_H_ |
OLD | NEW |