Index: chrome/browser/chrome_browser_application_mac.h |
diff --git a/chrome/browser/chrome_browser_application_mac.h b/chrome/browser/chrome_browser_application_mac.h |
index 510fa5b0f8b925c82d5caeb9faeeee7eac9bf3a7..37e2ef4c0df788ccdf0656914d60a2d4c9cecd9b 100644 |
--- a/chrome/browser/chrome_browser_application_mac.h |
+++ b/chrome/browser/chrome_browser_application_mac.h |
@@ -10,11 +10,31 @@ |
#import "content/common/chrome_application_mac.h" |
-@interface BrowserCrApplication : CrApplication |
+// Event hooks must implement this protocol. |
+@protocol CrApplicationEventHookProtocol |
+- (void)hookForEvent:(NSEvent*)theEvent; |
+@end |
+ |
+@interface BrowserCrApplication : CrApplication { |
+ // Array of objects implementing the CrApplicationEventHookProtocol |
Robert Sesek
2011/11/09 18:16:25
nit: full stop
Scott Hess - ex-Googler
2011/11/09 18:36:53
Done.
|
+ scoped_nsobject<NSMutableArray> eventHooks_; |
+} |
+ |
// Our implementation of |-terminate:| only attempts to terminate the |
// application, i.e., begins a process which may lead to termination. This |
// method cancels that process. |
- (void)cancelTerminate:(id)sender; |
+ |
+// Add or remove an event hook to be called for every sendEvent: |
+// that the application receives. These handlers are called before |
+// the normal [NSApplication sendEvent:] call is made. |
+ |
+// This is not a good alternative to a nested event loop. It should |
+// be used only when normal event logic and notification breaks down |
+// (e.g. when clicking outside a canBecomeKey:NO window to "switch |
+// context" out of it). |
+- (void)addEventHook:(id<CrApplicationEventHookProtocol>)hook; |
+- (void)removeEventHook:(id<CrApplicationEventHookProtocol>)hook; |
@end |
namespace chrome_browser_application_mac { |