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

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: ready for review 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..5aa2e0bb6190dfa1a60fecdbf9396206921b36cf 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1948,13 +1948,36 @@ 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 it disappears.
+ BOOL fullscreen_for_tab = browser_->is_fullscreen_for_tab();
Nico 2011/09/15 04:37:32 Ah. Maybe "allow_tab_switching_in_fullscreen()"?
jeremya 2011/09/15 06:33:28 That's not quite it -- we still allow tab switchin
+ [self setShowFloatingChrome:fullscreen && !fullscreen_for_tab];
+
+ if (fullscreen && fullscreen_for_tab) {
+ fullscreenExitBubbleController_.reset(
+ [[FullscreenExitBubbleController alloc] initWithOwner:self
+ browser:browser_.get()]);
+ NSView *contentView = [[self window] contentView];
Nico 2011/09/15 04:37:32 space goes to the right of *, not left
jeremya 2011/09/15 06:33:28 Done.
+ CGFloat maxY = [self placeBookmarkBarBelowInfoBar] ?
+ NSMinY([[toolbarController_ view] frame]) :
+ NSMinY([[bookmarkBarController_ view] frame]);
Nico 2011/09/15 04:37:32 Move this ?: construct into a well-named method
jeremya 2011/09/15 06:33:28 Done. ... actually, is there any reason I couldn'
+ NSRect fsebFrame = [[fullscreenExitBubbleController_ animatableView] frame];
Nico 2011/09/15 04:37:32 no abbreviations. bubbleFrame?
Nico 2011/09/15 04:37:32 It feels like all this frame computation business
jeremya 2011/09/15 06:33:28 Done.
jeremya 2011/09/15 06:33:28 Done.
+ CGFloat maxWidth = NSWidth([contentView frame]);
+ fsebFrame.origin.x = (int)(maxWidth/2-NSWidth(fsebFrame)/2);
+ fsebFrame.origin.y = maxY-NSHeight(fsebFrame);
+ [[fullscreenExitBubbleController_ view] setFrame:fsebFrame];
+ [contentView addSubview:[fullscreenExitBubbleController_ view]];
Nico 2011/09/15 04:37:32 Have you considered making the bubble a child wind
jeremya 2011/09/15 06:33:28 I hadn't seen that method until I saw the confirm_
Nico 2011/09/15 20:09:14 Most overlapping things are child windows (bookmar
+ } else {
+ [[fullscreenExitBubbleController_ view] removeFromSuperview];
+ fullscreenExitBubbleController_.reset();
Nico 2011/09/15 04:37:32 so non-js fullscreen won't get the bubble? wasn't
jeremya 2011/09/15 06:33:28 Correct. I don't think we need to notify the user
Nico 2011/09/15 20:09:14 Yes…email chrome-ui-leads, and cc rsesek. Just say
+ }
}
- (BOOL)isFullscreen {
@@ -2051,6 +2074,11 @@ willAnimateFromState:(bookmarks::VisualState)oldState
[self layoutSubviews];
}
+- (void)setShowFloatingChrome:(BOOL)showChrome {
Nico 2011/09/15 04:37:32 Do you want to DCHECK(showChrome ^ showFloating
jeremya 2011/09/15 06:33:28 Is layoutSubviews not idempotent? If not, perhaps
Nico 2011/09/15 20:09:14 I was thinking of two callers that don't know of e
+ showFloatingChrome_ = showChrome;
+ [self layoutSubviews];
+}
+
- (BOOL)isBarVisibilityLockedForOwner:(id)owner {
DCHECK(owner);
DCHECK(barVisibilityLocks_);

Powered by Google App Engine
This is Rietveld 408576698