Chromium Code Reviews| 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..84f3915d2c07d273ff6a72e0e811eebbdb982521 100644 |
| --- a/chrome/browser/chrome_browser_application_mac.h |
| +++ b/chrome/browser/chrome_browser_application_mac.h |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -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 { |
|
Robert Sesek
2011/11/09 18:38:59
@private
Scott Hess - ex-Googler
2011/11/09 18:48:32
Done. If you haven't noticed, I get dinged for th
|
| + // Array of objects implementing CrApplicationEventHookProtocol. |
| + 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 { |