Index: chrome/browser/ui/cocoa/base_bubble_controller.h |
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.h b/chrome/browser/ui/cocoa/base_bubble_controller.h |
index c64fbfc8f4a2e23dd6964cb3622bf304dbbd6fec..46b1de1831f7efb22faad91b5587612b4e6c055e 100644 |
--- a/chrome/browser/ui/cocoa/base_bubble_controller.h |
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.h |
@@ -31,6 +31,14 @@ class Bridge; |
IBOutlet InfoBubbleView* bubble_; // to set arrow position |
// Bridge that listens for notifications. |
scoped_ptr<BaseBubbleControllerInternal::Bridge> baseBridge_; |
+ |
+ // Non-nil only on 10.7+. Both weak, owned by AppKit. |
+ // A local event tap that will dismiss the bubble when a click is delivered |
+ // outside the window. This is needed because the window shares first |
+ // responder with its parent. |
+ id eventTap_; |
+ // A notification observer that gets triggered when any window resigns key. |
+ id resignationObserver_; |
} |
@property(nonatomic, readonly) NSWindow* parentWindow; |
@@ -71,3 +79,11 @@ class Bridge; |
- (NSBox*)separatorWithFrame:(NSRect)frame; |
@end |
+ |
+// Methods for use by subclasses. |
+@interface BaseBubbleController (Protected) |
+// Registers event taps *after* the window is shown so that the bubble is |
+// dismissed when it resigns key. This only needs to be called if |
+// |-showWindow:| is overriden and does not call super. Noop on OSes <10.7. |
+- (void)registerKeyStateEventTap; |
+@end |