Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Unified Diff: chrome/browser/chrome_browser_application_mac.h

Issue 8498034: [Mac] Move event hooks from CrApplication to BrowserCrApplication. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rsesek points. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_application_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_application_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698