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

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

Issue 390503003: Enables permission bubbles to remain visible during fulscreen on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 6 years, 5 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/presentation_mode_controller.mm
diff --git a/chrome/browser/ui/cocoa/presentation_mode_controller.mm b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
index 110629e2d6b5ba6e37d7697d56ee5840e09565fe..2b20af97d6c25322ab811dfbe6f7d82cd73f0abc 100644
--- a/chrome/browser/ui/cocoa/presentation_mode_controller.mm
+++ b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
@@ -166,6 +166,7 @@ const CGFloat kFloatingBarVerticalOffset = 22;
@implementation PresentationModeController
@synthesize inPresentationMode = inPresentationMode_;
+@synthesize alwaysShowDropdown = alwaysShowDropdown_;
- (id)initWithBrowserController:(BrowserWindowController*)controller {
if ((self = [super init])) {
@@ -193,6 +194,8 @@ const CGFloat kFloatingBarVerticalOffset = 22;
enteringPresentationMode_ = YES;
inPresentationMode_ = YES;
contentView_ = contentView;
+ if (alwaysShowDropdown_)
+ showDropdown = YES;
[self changeFloatingBarShownFraction:(showDropdown ? 1 : 0)];
// Register for notifications. Self is removed as an observer in |-cleanup|.
@@ -237,6 +240,14 @@ const CGFloat kFloatingBarVerticalOffset = 22;
[self cleanup];
}
+- (void)setAlwaysShowDropdown:(BOOL)alwaysShowDropdown {
+ alwaysShowDropdown_ = alwaysShowDropdown;
+ if (alwaysShowDropdown)
+ [self ensureOverlayShownWithAnimation:YES delay:YES];
+ else
+ [self ensureOverlayHiddenWithAnimation:YES delay:YES];
+}
+
- (void)windowDidChangeScreen:(NSNotification*)notification {
[browserController_ resizeFullscreenWindow];
}
@@ -316,6 +327,8 @@ const CGFloat kFloatingBarVerticalOffset = 22;
- (void)ensureOverlayHiddenWithAnimation:(BOOL)animate delay:(BOOL)delay {
if (!inPresentationMode_)
return;
+ if (alwaysShowDropdown_)
+ return;
if (animate) {
if (delay) {
@@ -500,6 +513,8 @@ const CGFloat kFloatingBarVerticalOffset = 22;
}
- (void)setupTrackingArea {
+ if (alwaysShowDropdown_)
+ return;
if (trackingArea_) {
// If the tracking rectangle is already |trackingAreaBounds_|, quit early.
NSRect oldRect = [trackingArea_ rect];
@@ -615,6 +630,7 @@ const CGFloat kFloatingBarVerticalOffset = 22;
}
- (void)hideTimerFire:(NSTimer*)timer {
+ DCHECK(!alwaysShowDropdown_);
DCHECK_EQ(hideTimer_, timer); // This better be our hide timer.
[hideTimer_ invalidate]; // Make sure it doesn't repeat.
hideTimer_.reset(); // And get rid of it.

Powered by Google App Engine
This is Rietveld 408576698