| Index: chrome/browser/ui/cocoa/browser_window_layout.h
|
| diff --git a/chrome/browser/ui/cocoa/browser_window_layout.h b/chrome/browser/ui/cocoa/browser_window_layout.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b38d9b35d740795c335ac191ae5d02e2f7c31519
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/cocoa/browser_window_layout.h
|
| @@ -0,0 +1,125 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_
|
| +#define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_
|
| +
|
| +#import <Cocoa/Cocoa.h>
|
| +
|
| +#import "chrome/browser/ui/cocoa/presentation_mode_controller.h"
|
| +
|
| +namespace mac_browser {
|
| +
|
| +// The height of the tab strip.
|
| +extern const CGFloat kTabStripHeight;
|
| +
|
| +// The parameters used to calculate the layout of the views managed by the
|
| +// BrowserWindowController.
|
| +struct LayoutParameters {
|
| + NSSize contentViewSize;
|
| + NSSize windowSize;
|
| +
|
| + // Whether the controller is in any fullscreen mode. This parameter should be
|
| + // NO if the controller is in the process of entering fullscreen.
|
| + BOOL inAnyFullscreen;
|
| + fullscreen_mac::SlidingStyle slidingStyle;
|
| + CGFloat menubarOffset;
|
| + CGFloat toolbarFraction;
|
| +
|
| + BOOL hasTabStrip;
|
| +
|
| + BOOL hasToolbar;
|
| + CGFloat toolbarHeight;
|
| +
|
| + BOOL hasLocationBar;
|
| +
|
| + BOOL placeBookmarkBarBelowInfoBar;
|
| + BOOL bookmarkBarHidden;
|
| + CGFloat bookmarkBarHeight;
|
| +
|
| + // The height of the info bar, not including the top arrow.
|
| + CGFloat infoBarHeight;
|
| + // The maximum allowed height of the top arrow.
|
| + CGFloat infoBarMaxTopArrowHeight;
|
| +
|
| + BOOL hasDownloadShelf;
|
| + CGFloat downloadShelfHeight;
|
| +};
|
| +
|
| +// The output frames of the views managed by the BrowserWindowController.
|
| +struct LayoutOutput {
|
| + NSRect tabStripFrame;
|
| + NSRect toolbarFrame;
|
| + NSRect bookmarkFrame;
|
| + NSRect fullscreenBackingBarFrame;
|
| + CGFloat findBarMaxY;
|
| + CGFloat fullscreenExitButtonMaxY;
|
| + NSRect infoBarFrame;
|
| + CGFloat infoBarMaxTopArrowHeight;
|
| + NSRect downloadShelfFrame;
|
| + NSRect contentAreaFrame;
|
| +};
|
| +
|
| +} // namespace mac_browser
|
| +
|
| +// Calculates the layout of the views managed by the BrowserWindowController.
|
| +@interface BrowserWindowLayout : NSObject {
|
| + @private
|
| + // Input parameters.
|
| + mac_browser::LayoutParameters parameters_;
|
| +
|
| + // Output.
|
| + mac_browser::LayoutOutput output_;
|
| +
|
| + // The offset of the maxY of the tab strip during fullscreen mode.
|
| + CGFloat fullscreenYOffset_;
|
| +
|
| + // The views are laid out from highest Y to lowest Y. This variable holds the
|
| + // current highest Y that the next view is expected to be laid under.
|
| + CGFloat maxY_;
|
| +}
|
| +
|
| +// Returns the height of the info bar container.
|
| ++ (CGFloat)infoBarContainerHeightFromInfoBarHeight:(CGFloat)infoBarHeight
|
| + maxTopArrowHeight:(CGFloat)maxTopArrowHeight;
|
| +
|
| +// Designated initializer.
|
| +- (instancetype)init;
|
| +
|
| +// ----------------Methods that configure input parameters----------------------
|
| +- (void)setContentViewSize:(NSSize)size;
|
| +- (void)setWindowSize:(NSSize)size;
|
| +
|
| +// Whether the controller is in any fullscreen mode. |inAnyFullscreen| should
|
| +// be NO if the controller is in the process of entering fullscreen.
|
| +- (void)setInAnyFullscreen:(BOOL)inAnyFullscreen;
|
| +- (void)setFullscreenSlidingStyle:(fullscreen_mac::SlidingStyle)slidingStyle;
|
| +- (void)setFullscreenMenubarOffset:(CGFloat)menubarOffset;
|
| +- (void)setFullscreenToolbarFraction:(CGFloat)toolbarFraction;
|
| +
|
| +- (void)setHasTabStrip:(BOOL)hasTabStrip;
|
| +
|
| +- (void)setHasToolbar:(BOOL)hasToolbar;
|
| +- (void)setHasLocationBar:(BOOL)hasLocationBar;
|
| +- (void)setToolbarHeight:(CGFloat)toolbarHeight;
|
| +
|
| +- (void)setBookmarkBarHidden:(BOOL)bookmarkBarHidden;
|
| +- (void)setPlaceBookmarkBarBelowInfoBar:(BOOL)placeBookmarkBarBelowInfoBar;
|
| +- (void)setBookmarkBarHeight:(CGFloat)bookmarkBarHeight;
|
| +
|
| +// The height of the info bar, not including the top arrow.
|
| +- (void)setInfoBarHeight:(CGFloat)infoBarHeight;
|
| +// The maximum allowed height of the top arrow.
|
| +- (void)setInfoBarMaxTopArrowHeight:(CGFloat)infoBarMaxTopArrowHeight;
|
| +
|
| +- (void)setHasDownloadShelf:(BOOL)hasDownloadShelf;
|
| +- (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight;
|
| +
|
| +// ----------------Methods that generate output---------------------------------
|
| +// Performs the layout computation and returns the results.
|
| +- (mac_browser::LayoutOutput)computeLayout;
|
| +
|
| +@end
|
| +
|
| +#endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_
|
|
|