| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 BASE_CHROME_APPLICATION_MAC_H_ | 5 #ifndef CHROME_COMMON_CHROME_APPLICATION_MAC_H_ |
| 6 #define BASE_CHROME_APPLICATION_MAC_H_ | 6 #define CHROME_COMMON_CHROME_APPLICATION_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <AppKit/AppKit.h> | 9 #import <AppKit/AppKit.h> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/message_pump_mac.h" |
| 12 #include "base/scoped_nsobject.h" | 13 #include "base/scoped_nsobject.h" |
| 13 | 14 |
| 14 // Event hooks must implement this protocol. | 15 // Event hooks must implement this protocol. |
| 15 @protocol CrApplicationEventHookProtocol | 16 @protocol CrApplicationEventHookProtocol |
| 16 - (void)hookForEvent:(NSEvent*)theEvent; | 17 - (void)hookForEvent:(NSEvent*)theEvent; |
| 17 @end | 18 @end |
| 18 | 19 |
| 19 | 20 |
| 20 @interface CrApplication : NSApplication { | 21 @interface CrApplication : NSApplication<CrAppProtocol> { |
| 21 @private | 22 @private |
| 22 BOOL handlingSendEvent_; | 23 BOOL handlingSendEvent_; |
| 23 // Array of objects implementing the CrApplicationEventHookProtocol | 24 // Array of objects implementing the CrApplicationEventHookProtocol |
| 24 scoped_nsobject<NSMutableArray> eventHooks_; | 25 scoped_nsobject<NSMutableArray> eventHooks_; |
| 25 } | 26 } |
| 26 @property(readonly, | 27 @property(readonly, |
| 27 getter=isHandlingSendEvent, | 28 getter=isHandlingSendEvent, |
| 28 nonatomic) BOOL handlingSendEvent; | 29 nonatomic) BOOL handlingSendEvent; |
| 29 | 30 |
| 30 // Add or remove an event hook to be called for every sendEvent: | 31 // Add or remove an event hook to be called for every sendEvent: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 51 ~ScopedSendingEvent(); | 52 ~ScopedSendingEvent(); |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 CrApplication* app_; | 55 CrApplication* app_; |
| 55 BOOL handling_; | 56 BOOL handling_; |
| 56 DISALLOW_COPY_AND_ASSIGN(ScopedSendingEvent); | 57 DISALLOW_COPY_AND_ASSIGN(ScopedSendingEvent); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // chrome_application_mac | 60 } // chrome_application_mac |
| 60 | 61 |
| 61 #endif // BASE_CHROME_APPLICATION_MAC_H_ | 62 #endif // CHROME_COMMON_CHROME_APPLICATION_MAC_H_ |
| OLD | NEW |