OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/browser_window_layout.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_layout.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 | 162 |
163 - (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight { | 163 - (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight { |
164 parameters_.downloadShelfHeight = downloadShelfHeight; | 164 parameters_.downloadShelfHeight = downloadShelfHeight; |
165 } | 165 } |
166 | 166 |
167 - (void)computeFullscreenYOffset { | 167 - (void)computeFullscreenYOffset { |
168 CGFloat yOffset = 0; | 168 CGFloat yOffset = 0; |
169 if (parameters_.inAnyFullscreen) { | 169 if (parameters_.inAnyFullscreen) { |
170 yOffset += parameters_.menubarOffset; | 170 yOffset += parameters_.menubarOffset; |
171 switch (parameters_.slidingStyle) { | 171 yOffset += std::floor((1 - parameters_.toolbarFraction) * |
172 case fullscreen_mac::OMNIBOX_TABS_PRESENT: | 172 [self fullscreenBackingBarHeight]); |
173 break; | |
174 case fullscreen_mac::OMNIBOX_TABS_NONE: | |
175 case fullscreen_mac::OMNIBOX_TABS_HIDDEN: | |
176 // In presentation mode, |yOffset| accounts for the sliding position of | |
177 // the floating bar and the extra offset needed to dodge the menu bar. | |
178 yOffset += std::floor((1 - parameters_.toolbarFraction) * | |
179 [self fullscreenBackingBarHeight]); | |
180 break; | |
181 } | |
182 } | 173 } |
183 fullscreenYOffset_ = yOffset; | 174 fullscreenYOffset_ = yOffset; |
184 } | 175 } |
185 | 176 |
186 - (void)computeTabStripLayout { | 177 - (void)computeTabStripLayout { |
187 if (!parameters_.hasTabStrip) { | 178 if (!parameters_.hasTabStrip) { |
188 maxY_ = parameters_.contentViewSize.height + fullscreenYOffset_; | 179 maxY_ = parameters_.contentViewSize.height + fullscreenYOffset_; |
189 return; | 180 return; |
190 } | 181 } |
191 | 182 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 386 |
396 @end | 387 @end |
397 | 388 |
398 @implementation BrowserWindowLayout (ExposedForTesting) | 389 @implementation BrowserWindowLayout (ExposedForTesting) |
399 | 390 |
400 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { | 391 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { |
401 parameters_.isOSYosemiteOrLater = osYosemiteOrLater; | 392 parameters_.isOSYosemiteOrLater = osYosemiteOrLater; |
402 } | 393 } |
403 | 394 |
404 @end | 395 @end |
OLD | NEW |