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 2628f054b5f22ba95cef1810e560206f57918a5f..fd19a0d65663ef6af155f4755959d29121d8daa2 100644 |
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm |
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm |
@@ -8,6 +8,7 @@ |
#include "base/mac/bundle_locations.h" |
#include "base/mac/mac_util.h" |
#include "base/mac/scoped_nsobject.h" |
+#include "base/mac/sdk_forward_declarations.h" |
#include "base/strings/string_util.h" |
#import "chrome/browser/ui/cocoa/browser_window_controller.h" |
#import "chrome/browser/ui/cocoa/info_bubble_view.h" |
@@ -25,6 +26,7 @@ |
- (void)recordAnchorOffset; |
- (void)parentWindowDidResize:(NSNotification*)notification; |
- (void)parentWindowWillClose:(NSNotification*)notification; |
+- (void)parentWindowWillBecomeFullScreen:(NSNotification*)notification; |
- (void)closeCleanup; |
@end |
@@ -119,6 +121,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 |
+ object:parentWindow_]; |
// Watch for parent window's resizing, to ensure this one is always |
// anchored correctly. |
[center addObserver:self |
@@ -151,6 +158,9 @@ |
} |
- (void)parentWindowDidResize:(NSNotification*)notification { |
+ if (!parentWindow_) |
+ return; |
+ |
DCHECK_EQ(parentWindow_, [notification object]); |
NSPoint newOrigin = NSMakePoint(NSMinX([parentWindow_ frame]), |
NSMaxY([parentWindow_ frame])); |
@@ -164,6 +174,11 @@ |
[self close]; |
} |
+- (void)parentWindowWillBecomeFullScreen:(NSNotification*)notification { |
+ parentWindow_ = nil; |
+ [self close]; |
+} |
+ |
- (void)closeCleanup { |
if (eventTap_) { |
[NSEvent removeMonitor:eventTap_]; |