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

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: add test 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..7ec44caf075392ec9eff30bfc50a54cc29280cc8 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1408,6 +1408,12 @@ enum {
return downloadShelfController_;
}
+- (CGFloat)maxYForViewInsideContent {
+ return [self placeBookmarkBarBelowInfoBar] ?
+ NSMinY([[toolbarController_ view] frame]) :
+ NSMinY([[bookmarkBarController_ view] frame]);
+}
+
- (void)addFindBar:(FindBarCocoaController*)findBarCocoaController {
// Shouldn't call addFindBar twice.
DCHECK(!findBarCocoaController_.get());
@@ -1425,9 +1431,7 @@ enum {
// Place the find bar immediately below the toolbar/attached bookmark bar. In
// presentation mode, it hangs off the top of the screen when the bar is
// hidden.
- CGFloat maxY = [self placeBookmarkBarBelowInfoBar] ?
- NSMinY([[toolbarController_ view] frame]) :
- NSMinY([[bookmarkBarController_ view] frame]);
+ CGFloat maxY = [self maxYForViewInsideContent];
CGFloat maxWidth = NSWidth([contentView frame]);
[findBarCocoaController_ positionFindBarViewAtMaxY:maxY maxWidth:maxWidth];
@@ -1948,13 +1952,32 @@ 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.
Nico 2011/09/15 20:09:14 Have you tested this with the "always on" overlay
jeremya 2011/09/16 03:39:58 Good call. Testing on Lion reveals a bunch of bugs
+ BOOL show_exit_info_bubble = browser_->is_fullscreen_for_tab();
+ [self setShowFloatingChrome:fullscreen && !show_exit_info_bubble];
+
+ if (fullscreen && show_exit_info_bubble) {
+ fullscreenExitBubbleController_.reset(
+ [[FullscreenExitBubbleController alloc] initWithOwner:self
+ browser:browser_.get()]);
+ NSView* contentView = [[self window] contentView];
+ CGFloat maxWidth = NSWidth([contentView frame]);
+ CGFloat maxY = [self maxYForViewInsideContent];
+ [fullscreenExitBubbleController_
+ positionInWindowAtTop:maxY width:maxWidth];
+ [contentView addSubview:[fullscreenExitBubbleController_ view]];
+ } else {
+ [[fullscreenExitBubbleController_ view] removeFromSuperview];
+ fullscreenExitBubbleController_.reset();
+ }
}
- (BOOL)isFullscreen {
@@ -2051,6 +2074,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