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 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" | 10 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // details. | 29 // details. |
30 fullscreen_mac::SlidingStyle slidingStyle; | 30 fullscreen_mac::SlidingStyle slidingStyle; |
31 // The minY of the AppKit Menu Bar, relative to the top of the screen. Ranges | 31 // The minY of the AppKit Menu Bar, relative to the top of the screen. Ranges |
32 // from 0 to -22. Only relevant in fullscreen mode. | 32 // from 0 to -22. Only relevant in fullscreen mode. |
33 CGFloat menubarOffset; | 33 CGFloat menubarOffset; |
34 // The fraction of the sliding toolbar that is visible in fullscreenm mode. | 34 // The fraction of the sliding toolbar that is visible in fullscreenm mode. |
35 // Ranges from 0 to 1. Only relevant in fullscreen mode. | 35 // Ranges from 0 to 1. Only relevant in fullscreen mode. |
36 CGFloat toolbarFraction; | 36 CGFloat toolbarFraction; |
37 | 37 |
38 BOOL hasTabStrip; | 38 BOOL hasTabStrip; |
| 39 // The frame of the fullscreen button. May be NSZeroRect if the fullscreen |
| 40 // button doesn't exist. Only needs to be set when hasTabStrip is YES. |
| 41 NSRect fullscreenButtonFrame; |
| 42 // Whether the avatar button should be shown. Only needs to be set when |
| 43 // hasTabStrip is YES. |
| 44 BOOL shouldShowAvatar; |
| 45 // Whether to use the new avatar button. Only needs to be set when |
| 46 // shouldShowAvatar is YES. |
| 47 BOOL shouldUseNewAvatar; |
| 48 // The size of the avatar button. Only needs to be set when shouldShowAvatar |
| 49 // is YES. |
| 50 NSSize avatarSize; |
| 51 // The line width that will generate a 1 pixel wide line for the avatar's |
| 52 // superview. Only needs to be set when shouldShowAvatar is YES. |
| 53 CGFloat avatarLineWidth; |
39 | 54 |
40 BOOL hasToolbar; | 55 BOOL hasToolbar; |
41 BOOL hasLocationBar; | 56 BOOL hasLocationBar; |
42 CGFloat toolbarHeight; | 57 CGFloat toolbarHeight; |
43 | 58 |
44 BOOL bookmarkBarHidden; | 59 BOOL bookmarkBarHidden; |
45 // If the bookmark bar is not hidden, then the bookmark bar should either be | 60 // If the bookmark bar is not hidden, then the bookmark bar should either be |
46 // directly below the omnibox, or directly below the info bar. This parameter | 61 // directly below the omnibox, or directly below the info bar. This parameter |
47 // selects between those 2 cases. | 62 // selects between those 2 cases. |
48 BOOL placeBookmarkBarBelowInfoBar; | 63 BOOL placeBookmarkBarBelowInfoBar; |
49 CGFloat bookmarkBarHeight; | 64 CGFloat bookmarkBarHeight; |
50 | 65 |
51 // The height of the info bar, not including the top arrow. | 66 // The height of the info bar, not including the top arrow. |
52 CGFloat infoBarHeight; | 67 CGFloat infoBarHeight; |
53 // The distance from the bottom of the location icon to the bottom of the | 68 // The distance from the bottom of the location icon to the bottom of the |
54 // toolbar. | 69 // toolbar. |
55 CGFloat pageInfoBubblePointY; | 70 CGFloat pageInfoBubblePointY; |
56 | 71 |
57 BOOL hasDownloadShelf; | 72 BOOL hasDownloadShelf; |
58 CGFloat downloadShelfHeight; | 73 CGFloat downloadShelfHeight; |
59 }; | 74 }; |
60 | 75 |
61 // The output frames of the views managed by the BrowserWindowController. | 76 // The parameters required to lay out the tab strip and its components. |
| 77 struct TabStripLayout { |
| 78 // The frame of the tab strip in window coordinates. |
| 79 NSRect frame; |
| 80 // The left indent for the controls of the TabStripController. |
| 81 CGFloat leftIndent; |
| 82 // The right indent for the controls of the TabStripController. |
| 83 CGFloat rightIndent; |
| 84 // Whether the TabStripController needs to add custom traffic light buttons. |
| 85 BOOL addCustomWindowControls; |
| 86 // The frame of the avatar in window coordinates. |
| 87 NSRect avatarFrame; |
| 88 }; |
| 89 |
| 90 // The output frames of the views managed by the BrowserWindowController. All |
| 91 // frames are in the coordinate system of the window. The lower-left corner of |
| 92 // the contentView coincides with the lower-left corner of the window, so these |
| 93 // frames are also in the coordinate system of the contentView. |
62 struct LayoutOutput { | 94 struct LayoutOutput { |
63 NSRect tabStripFrame; | 95 TabStripLayout tabStripLayout; |
64 NSRect toolbarFrame; | 96 NSRect toolbarFrame; |
65 NSRect bookmarkFrame; | 97 NSRect bookmarkFrame; |
66 NSRect fullscreenBackingBarFrame; | 98 NSRect fullscreenBackingBarFrame; |
67 CGFloat findBarMaxY; | 99 CGFloat findBarMaxY; |
68 CGFloat fullscreenExitButtonMaxY; | 100 CGFloat fullscreenExitButtonMaxY; |
69 NSRect infoBarFrame; | 101 NSRect infoBarFrame; |
70 CGFloat infoBarMaxTopArrowHeight; | 102 CGFloat infoBarMaxTopArrowHeight; |
71 NSRect downloadShelfFrame; | 103 NSRect downloadShelfFrame; |
72 NSRect contentAreaFrame; | 104 NSRect contentAreaFrame; |
73 }; | 105 }; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 - (void)setWindowSize:(NSSize)size; | 139 - (void)setWindowSize:(NSSize)size; |
108 | 140 |
109 // Whether the controller is in any fullscreen mode. |inAnyFullscreen| should | 141 // Whether the controller is in any fullscreen mode. |inAnyFullscreen| should |
110 // be NO if the controller is in the process of entering fullscreen. | 142 // be NO if the controller is in the process of entering fullscreen. |
111 - (void)setInAnyFullscreen:(BOOL)inAnyFullscreen; | 143 - (void)setInAnyFullscreen:(BOOL)inAnyFullscreen; |
112 - (void)setFullscreenSlidingStyle:(fullscreen_mac::SlidingStyle)slidingStyle; | 144 - (void)setFullscreenSlidingStyle:(fullscreen_mac::SlidingStyle)slidingStyle; |
113 - (void)setFullscreenMenubarOffset:(CGFloat)menubarOffset; | 145 - (void)setFullscreenMenubarOffset:(CGFloat)menubarOffset; |
114 - (void)setFullscreenToolbarFraction:(CGFloat)toolbarFraction; | 146 - (void)setFullscreenToolbarFraction:(CGFloat)toolbarFraction; |
115 | 147 |
116 - (void)setHasTabStrip:(BOOL)hasTabStrip; | 148 - (void)setHasTabStrip:(BOOL)hasTabStrip; |
| 149 - (void)setFullscreenButtonFrame:(NSRect)frame; |
| 150 - (void)setShouldShowAvatar:(BOOL)shouldShowAvatar; |
| 151 - (void)setShouldUseNewAvatar:(BOOL)shouldUseNewAvatar; |
| 152 - (void)setAvatarSize:(NSSize)avatarSize; |
| 153 - (void)setAvatarLineWidth:(BOOL)avatarLineWidth; |
117 | 154 |
118 - (void)setHasToolbar:(BOOL)hasToolbar; | 155 - (void)setHasToolbar:(BOOL)hasToolbar; |
119 - (void)setHasLocationBar:(BOOL)hasLocationBar; | 156 - (void)setHasLocationBar:(BOOL)hasLocationBar; |
120 - (void)setToolbarHeight:(CGFloat)toolbarHeight; | 157 - (void)setToolbarHeight:(CGFloat)toolbarHeight; |
121 | 158 |
122 - (void)setBookmarkBarHidden:(BOOL)bookmarkBarHidden; | 159 - (void)setBookmarkBarHidden:(BOOL)bookmarkBarHidden; |
123 - (void)setPlaceBookmarkBarBelowInfoBar:(BOOL)placeBookmarkBarBelowInfoBar; | 160 - (void)setPlaceBookmarkBarBelowInfoBar:(BOOL)placeBookmarkBarBelowInfoBar; |
124 - (void)setBookmarkBarHeight:(CGFloat)bookmarkBarHeight; | 161 - (void)setBookmarkBarHeight:(CGFloat)bookmarkBarHeight; |
125 | 162 |
126 // The height of the info bar, not including the top arrow. | 163 // The height of the info bar, not including the top arrow. |
127 - (void)setInfoBarHeight:(CGFloat)infoBarHeight; | 164 - (void)setInfoBarHeight:(CGFloat)infoBarHeight; |
128 // The min Y of the bubble point, relative to the toolbar. | 165 // The min Y of the bubble point, relative to the toolbar. |
129 - (void)setPageInfoBubblePointY:(CGFloat)pageInfoBubblePointY; | 166 - (void)setPageInfoBubblePointY:(CGFloat)pageInfoBubblePointY; |
130 | 167 |
131 - (void)setHasDownloadShelf:(BOOL)hasDownloadShelf; | 168 - (void)setHasDownloadShelf:(BOOL)hasDownloadShelf; |
132 - (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight; | 169 - (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight; |
133 | 170 |
134 @end | 171 @end |
135 | 172 |
136 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_ | 173 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_ |
OLD | NEW |