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

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

Issue 320393005: Close the bubble when entering full screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« AUTHORS ('K') | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_];
« AUTHORS ('K') | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698