Chromium Code Reviews| 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 CONTENT_COMMON_CHROME_APPLICATION_MAC_H_ | 5 #ifndef CONTENT_COMMON_CHROME_APPLICATION_MAC_H_ |
| 6 #define CONTENT_COMMON_CHROME_APPLICATION_MAC_H_ | 6 #define CONTENT_COMMON_CHROME_APPLICATION_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #if defined(__OBJC__) | 9 #if defined(__OBJC__) |
| 10 | 10 |
| 11 #import <AppKit/AppKit.h> | 11 #import <AppKit/AppKit.h> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/memory/scoped_nsobject.h" | 14 #include "base/memory/scoped_nsobject.h" |
| 15 #include "base/message_pump_mac.h" | 15 #include "base/message_pump_mac.h" |
| 16 | 16 |
| 17 // Event hooks must implement this protocol. | 17 // Event hooks must implement this protocol. |
| 18 @protocol CrApplicationEventHookProtocol | 18 @protocol CrApplicationEventHookProtocol |
| 19 - (void)hookForEvent:(NSEvent*)theEvent; | 19 - (void)hookForEvent:(NSEvent*)theEvent; |
| 20 @end | 20 @end |
| 21 | 21 |
| 22 | |
| 23 @interface CrApplication : NSApplication<CrAppProtocol> { | 22 @interface CrApplication : NSApplication<CrAppProtocol> { |
| 24 @private | 23 @private |
| 25 BOOL handlingSendEvent_; | 24 BOOL handlingSendEvent_; |
| 26 // Array of objects implementing the CrApplicationEventHookProtocol | 25 // Array of objects implementing the CrApplicationEventHookProtocol |
| 27 scoped_nsobject<NSMutableArray> eventHooks_; | 26 scoped_nsobject<NSMutableArray> eventHooks_; |
| 28 } | 27 } |
| 29 - (BOOL)isHandlingSendEvent; | 28 - (BOOL)isHandlingSendEvent; |
| 30 | 29 |
| 31 // Unconditionally clears |handlingSendEvent_|. This should not be | 30 // Unconditionally clears |handlingSendEvent_|. This should not be |
| 32 // used except in recovering from some sort of exceptional condition. | 31 // used except in recovering from some sort of exceptional condition. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 } // namespace chrome_application_mac | 63 } // namespace chrome_application_mac |
| 65 | 64 |
| 66 #endif // defined(__OBJC__) | 65 #endif // defined(__OBJC__) |
| 67 | 66 |
| 68 namespace chrome_application_mac { | 67 namespace chrome_application_mac { |
| 69 | 68 |
| 70 // To be used to instantiate CrApplication from C++ code. | 69 // To be used to instantiate CrApplication from C++ code. |
| 71 void RegisterCrApp(); | 70 void RegisterCrApp(); |
| 71 void SetHandler(); | |
|
Nico
2011/07/22 16:53:55
This needs a better name. (at least SetCloudPrintH
abeera
2011/07/22 20:59:03
Name changed. This is essentially a wrapper for an
Nico
2011/07/22 21:02:53
The browser process has this file: http://codesear
| |
| 72 | 72 |
| 73 } // namespace chrome_application_mac | 73 } // namespace chrome_application_mac |
| 74 | 74 |
| 75 #endif // CONTENT_COMMON_CHROME_APPLICATION_MAC_H_ | 75 #endif // CONTENT_COMMON_CHROME_APPLICATION_MAC_H_ |
| OLD | NEW |