| 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..4adedaa74ba39c8f10f321381661c658e2466647 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_];
|
|
|