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

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

Issue 607603003: Mac: Minor fullscreen adjustments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix presentation mode unit test. Created 6 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_layout.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_layout.mm b/chrome/browser/ui/cocoa/browser_window_layout.mm
index 0b303b5bf73b60163c33adbd1f19c3b912e3bc18..227c9842f5cc12ad657860e29388136b99b6d43c 100644
--- a/chrome/browser/ui/cocoa/browser_window_layout.mm
+++ b/chrome/browser/ui/cocoa/browser_window_layout.mm
@@ -195,18 +195,12 @@ const CGFloat kLocBarBottomInset = 1;
output_.findBarMaxY = maxY;
output_.fullscreenExitButtonMaxY = maxY;
- if (parameters_.inAnyFullscreen) {
- switch (parameters_.slidingStyle) {
- case fullscreen_mac::OMNIBOX_TABS_PRESENT:
- // Do nothing in Canonical Fullscreen. All content slides.
- break;
- case fullscreen_mac::OMNIBOX_TABS_HIDDEN:
- // If in presentation mode, reset |maxY| to top of screen, so that the
- // floating bar slides over the things which appear to be in the content
- // area.
- maxY = parameters_.contentViewSize.height;
- break;
- }
+ if (parameters_.inAnyFullscreen &&
+ parameters_.slidingStyle == fullscreen_mac::OMNIBOX_TABS_HIDDEN) {
+ // If in presentation mode, reset |maxY| to top of screen, so that the
+ // floating bar slides over the things which appear to be in the content
+ // area.
+ maxY = parameters_.windowSize.height;
}
// Lay out the info bar. It is never hidden. The frame needs to be high
@@ -245,6 +239,17 @@ const CGFloat kLocBarBottomInset = 1;
minY = NSMaxY(output_.downloadShelfFrame);
}
+ if (parameters_.inAnyFullscreen &&
+ parameters_.slidingStyle == fullscreen_mac::OMNIBOX_TABS_PRESENT) {
+ // If in Canonical Fullscreen, content should be shifted down by an amount
+ // equal to all the widgets and views at the top of the window. It should
+ // not be further shifted by the appearance/disappearance of the AppKit
+ // menu bar.
+ maxY = parameters_.windowSize.height;
+ maxY -= NSHeight(output_.toolbarFrame) + NSHeight(output_.tabStripFrame) +
+ NSHeight(output_.bookmarkFrame) + parameters.infoBarHeight;
+ }
+
// All the remaining space becomes the frame of the content area.
output_.contentAreaFrame = NSMakeRect(0, minY, width, maxY - minY);
}

Powered by Google App Engine
This is Rietveld 408576698