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

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

Issue 7890056: FullscreenExitBubble temp UI for Mac. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 3 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/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 6444bbce94fb7c45801a7a0a15062afe12f7b5b8..a0d6d8b0318d39def20ac3e9f29cfe358102fa76 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1948,13 +1948,34 @@ willAnimateFromState:(bookmarks::VisualState)oldState
enteredPresentationModeFromFullscreen_ = YES;
if ([[self window] isKindOfClass:[FramedBrowserWindow class]])
[static_cast<FramedBrowserWindow*>([self window]) toggleSystemFullScreen];
- return;
+ } else {
+ if (fullscreen)
+ [self enterFullscreenForSnowLeopardOrEarlier];
+ else
+ [self exitFullscreenForSnowLeopardOrEarlier];
}
- if (fullscreen)
- [self enterFullscreenForSnowLeopardOrEarlier];
- else
- [self exitFullscreenForSnowLeopardOrEarlier];
+ // Disable the floating tab bar if this fullscreen request was from a page.
+ // It will be re-enabled by the FullscreenExitBubble after the user dismisses the bubble.
+ [self setShowFloatingChrome:NO/*fullscreen && url.is_empty()*/];
+
+ if (fullscreen /*&& !url.is_empty()*/) {
+ fullscreenExitBubbleController_.reset(
+ [[FullscreenExitBubbleController alloc] initWithOwner:self browser:browser_.get()]);
+ NSView *contentView = [[self window] contentView];
+ CGFloat maxY = [self placeBookmarkBarBelowInfoBar] ?
+ NSMinY([[toolbarController_ view] frame]) :
+ NSMinY([[bookmarkBarController_ view] frame]);
+ NSRect fsebFrame = [[fullscreenExitBubbleController_ animatableView] frame];
+ CGFloat maxWidth = NSWidth([contentView frame]);
+ fsebFrame.origin.x = maxWidth/2-NSWidth(fsebFrame)/2;
+ fsebFrame.origin.y = maxY-NSHeight(fsebFrame);
+ [[fullscreenExitBubbleController_ view] setFrame:fsebFrame];
+ [contentView addSubview:[fullscreenExitBubbleController_ view]];
+ } else {
+ [[fullscreenExitBubbleController_ view] removeFromSuperview];
+ fullscreenExitBubbleController_.reset();
+ }
}
- (BOOL)isFullscreen {
@@ -2051,6 +2072,11 @@ willAnimateFromState:(bookmarks::VisualState)oldState
[self layoutSubviews];
}
+- (void)setShowFloatingChrome:(BOOL)showChrome {
+ showFloatingChrome_ = showChrome;
+ [self layoutSubviews];
+}
+
- (BOOL)isBarVisibilityLockedForOwner:(id)owner {
DCHECK(owner);
DCHECK(barVisibilityLocks_);

Powered by Google App Engine
This is Rietveld 408576698