Index: chrome/browser/ui/cocoa/base_bubble_controller.mm |
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm |
index 6dc573696ead2092213d8890b6db9d917a2d2f5f..20599bf4a901ad185fd06a6a94330c2af73b5344 100644 |
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm |
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm |
@@ -25,6 +25,7 @@ |
- (void)recordAnchorOffset; |
- (void)parentWindowDidResize:(NSNotification*)notification; |
- (void)parentWindowWillClose:(NSNotification*)notification; |
+- (void)parentWindowWillBecomeFullScreen:(NSNotification*)notification; |
- (void)closeCleanup; |
@end |
@@ -119,6 +120,11 @@ |
selector:@selector(parentWindowWillClose:) |
name:NSWindowWillCloseNotification |
object:parentWindow_]; |
+ // Watch for the full screen event, if so, close the bubble |
+ [center addObserver:self |
+ selector:@selector(parentWindowWillBecomeFullScreen:) |
+ name:NSWindowWillEnterFullScreenNotification |
Robert Sesek
2014/06/11 15:03:54
This notification is only available on 10.7 and la
|
+ object:parentWindow_]; |
// Watch for parent window's resizing, to ensure this one is always |
// anchored correctly. |
[center addObserver:self |
@@ -151,6 +157,9 @@ |
} |
- (void)parentWindowDidResize:(NSNotification*)notification { |
+ if (!parentWindow_) |
+ return; |
+ |
DCHECK_EQ(parentWindow_, [notification object]); |
NSPoint newOrigin = NSMakePoint(NSMinX([parentWindow_ frame]), |
NSMaxY([parentWindow_ frame])); |
@@ -164,6 +173,11 @@ |
[self close]; |
} |
+- (void)parentWindowWillBecomeFullScreen:(NSNotification*)notification { |
+ parentWindow_ = nil; |
+ [self close]; |
+} |
+ |
- (void)closeCleanup { |
if (eventTap_) { |
[NSEvent removeMonitor:eventTap_]; |