| 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)setBookmarkBarHeight:(CGFloat)bookmarkBarHeight { | 163 - (void)setBookmarkBarHeight:(CGFloat)bookmarkBarHeight { |
| 164 parameters_.bookmarkBarHeight = bookmarkBarHeight; | 164 parameters_.bookmarkBarHeight = bookmarkBarHeight; |
| 165 } | 165 } |
| 166 | 166 |
| 167 - (void)setInfoBarHeight:(CGFloat)infoBarHeight { | 167 - (void)setInfoBarHeight:(CGFloat)infoBarHeight { |
| 168 parameters_.infoBarHeight = infoBarHeight; | 168 parameters_.infoBarHeight = infoBarHeight; |
| 169 } | 169 } |
| 170 | 170 |
| 171 - (void)setPageInfoBubblePointY:(CGFloat)pageInfoBubblePointY { | 171 - (void)setInfoBarAnchorPointY:(CGFloat)infoBarAnchorPointY { |
| 172 parameters_.pageInfoBubblePointY = pageInfoBubblePointY; | 172 parameters_.infoBarAnchorPointY = infoBarAnchorPointY; |
| 173 } | 173 } |
| 174 | 174 |
| 175 - (void)setHasDownloadShelf:(BOOL)hasDownloadShelf { | 175 - (void)setHasDownloadShelf:(BOOL)hasDownloadShelf { |
| 176 parameters_.hasDownloadShelf = hasDownloadShelf; | 176 parameters_.hasDownloadShelf = hasDownloadShelf; |
| 177 } | 177 } |
| 178 | 178 |
| 179 - (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight { | 179 - (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight { |
| 180 parameters_.downloadShelfHeight = downloadShelfHeight; | 180 parameters_.downloadShelfHeight = downloadShelfHeight; |
| 181 } | 181 } |
| 182 | 182 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // Lay out the info bar. It is never hidden. | 336 // Lay out the info bar. It is never hidden. |
| 337 if (parameters_.infoBarHeight != 0) { | 337 if (parameters_.infoBarHeight != 0) { |
| 338 CGFloat infoBarMaxY = maxY; | 338 CGFloat infoBarMaxY = maxY; |
| 339 CGFloat infoBarMinY = maxY - parameters_.infoBarHeight; | 339 CGFloat infoBarMinY = maxY - parameters_.infoBarHeight; |
| 340 | 340 |
| 341 // If there's a toolbar, then the frame needs to be high enough to | 341 // If there's a toolbar, then the frame needs to be high enough to |
| 342 // accomodate the top arrow, which might stretch all the way to the page | 342 // accomodate the top arrow, which might stretch all the way to the page |
| 343 // info bubble icon. | 343 // info bubble icon. |
| 344 if (parameters_.hasToolbar) { | 344 if (parameters_.hasToolbar) { |
| 345 infoBarMaxY = | 345 infoBarMaxY = |
| 346 NSMinY(output_.toolbarFrame) + parameters.pageInfoBubblePointY; | 346 NSMinY(output_.toolbarFrame) + parameters.infoBarAnchorPointY; |
| 347 } | 347 } |
| 348 | 348 |
| 349 output_.infoBarFrame = | 349 output_.infoBarFrame = |
| 350 NSMakeRect(0, infoBarMinY, width, infoBarMaxY - infoBarMinY); | 350 NSMakeRect(0, infoBarMinY, width, infoBarMaxY - infoBarMinY); |
| 351 output_.infoBarMaxTopArrowHeight = | 351 output_.infoBarMaxTopArrowHeight = |
| 352 NSHeight(output_.infoBarFrame) - parameters_.infoBarHeight; | 352 NSHeight(output_.infoBarFrame) - parameters_.infoBarHeight; |
| 353 maxY = NSMinY(output_.infoBarFrame); | 353 maxY = NSMinY(output_.infoBarFrame); |
| 354 } else { | 354 } else { |
| 355 // The info bar has 0 height, but tests still expect it in the right | 355 // The info bar has 0 height, but tests still expect it in the right |
| 356 // location. | 356 // location. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 @end | 416 @end |
| 417 | 417 |
| 418 @implementation BrowserWindowLayout (ExposedForTesting) | 418 @implementation BrowserWindowLayout (ExposedForTesting) |
| 419 | 419 |
| 420 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { | 420 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { |
| 421 parameters_.isOSYosemiteOrLater = osYosemiteOrLater; | 421 parameters_.isOSYosemiteOrLater = osYosemiteOrLater; |
| 422 } | 422 } |
| 423 | 423 |
| 424 @end | 424 @end |
| OLD | NEW |