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

Unified Diff: chrome/browser/ui/cocoa/base_bubble_controller.h

Issue 9732012: [Mac] Have BaseBubbleController dismiss bubbles when they would lose key state on 10.8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 9 months 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/ui/cocoa/base_bubble_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/base_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698