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

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: add dependency for linking 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
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_];

Powered by Google App Engine
This is Rietveld 408576698