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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_layout.h

Issue 607723002: mac: Refactor tab strip layout logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tabstrip_relayout_bug_base
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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
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.
41 NSRect fullscreenButtonFrame;
42 // Whether the avatar button should be shown.
43 BOOL shouldShowAvatar;
44 // Whether to use the new avatar button.
45 BOOL shouldUseNewAvatar;
Robert Sesek 2014/09/26 16:55:54 Does shouldShowAvatar have to be YES for this to b
erikchen 2014/09/26 17:39:05 I've updated the comments to indicate that this pa
46 // The size of the avatar button.
Robert Sesek 2014/09/26 16:55:54 What is this if shouldShowAvatar is NO?
erikchen 2014/09/26 17:39:05 ditto
47 NSSize avatarSize;
48 // The line width that will generate a 1 pixel wide line for the avatar's
49 // superview.
50 CGFloat avatarLineWidth;
39 51
40 BOOL hasToolbar; 52 BOOL hasToolbar;
41 BOOL hasLocationBar; 53 BOOL hasLocationBar;
42 CGFloat toolbarHeight; 54 CGFloat toolbarHeight;
43 55
44 BOOL bookmarkBarHidden; 56 BOOL bookmarkBarHidden;
45 // If the bookmark bar is not hidden, then the bookmark bar should either be 57 // 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 58 // directly below the omnibox, or directly below the info bar. This parameter
47 // selects between those 2 cases. 59 // selects between those 2 cases.
48 BOOL placeBookmarkBarBelowInfoBar; 60 BOOL placeBookmarkBarBelowInfoBar;
49 CGFloat bookmarkBarHeight; 61 CGFloat bookmarkBarHeight;
50 62
51 // The height of the info bar, not including the top arrow. 63 // The height of the info bar, not including the top arrow.
52 CGFloat infoBarHeight; 64 CGFloat infoBarHeight;
53 // The distance from the bottom of the location icon to the bottom of the 65 // The distance from the bottom of the location icon to the bottom of the
54 // toolbar. 66 // toolbar.
55 CGFloat pageInfoBubblePointY; 67 CGFloat pageInfoBubblePointY;
56 68
57 BOOL hasDownloadShelf; 69 BOOL hasDownloadShelf;
58 CGFloat downloadShelfHeight; 70 CGFloat downloadShelfHeight;
59 }; 71 };
60 72
61 // The output frames of the views managed by the BrowserWindowController. 73 // The parameters required to lay out the tab strip and its components.
74 struct TabStripLayout {
75 // The frame of the tab strip in window coordinates.
76 NSRect frame;
77 CGFloat leftIndent;
Robert Sesek 2014/09/26 16:55:54 What are these idnenting?
erikchen 2014/09/26 17:39:05 Added comments. The indent is for the controls of
78 CGFloat rightIndent;
79 BOOL addWindowControls;
Robert Sesek 2014/09/26 16:55:54 Comment.
erikchen 2014/09/26 17:39:05 Done. "Whether the TabStripController needs to add
80 // The frame of the avatar in window coordinates.
81 NSRect avatarFrame;
82 };
83
84 // The output frames of the views managed by the BrowserWindowController. All
85 // frames are in the coordinate system of the window. The lower-left corner of
86 // the contentView coincides with the lower-left corner of the window, so these
87 // frames are also in the coordinate system of the contentView.
62 struct LayoutOutput { 88 struct LayoutOutput {
63 NSRect tabStripFrame; 89 TabStripLayout tabStripLayout;
64 NSRect toolbarFrame; 90 NSRect toolbarFrame;
65 NSRect bookmarkFrame; 91 NSRect bookmarkFrame;
66 NSRect fullscreenBackingBarFrame; 92 NSRect fullscreenBackingBarFrame;
67 CGFloat findBarMaxY; 93 CGFloat findBarMaxY;
68 CGFloat fullscreenExitButtonMaxY; 94 CGFloat fullscreenExitButtonMaxY;
69 NSRect infoBarFrame; 95 NSRect infoBarFrame;
70 CGFloat infoBarMaxTopArrowHeight; 96 CGFloat infoBarMaxTopArrowHeight;
71 NSRect downloadShelfFrame; 97 NSRect downloadShelfFrame;
72 NSRect contentAreaFrame; 98 NSRect contentAreaFrame;
73 }; 99 };
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 - (void)setWindowSize:(NSSize)size; 133 - (void)setWindowSize:(NSSize)size;
108 134
109 // Whether the controller is in any fullscreen mode. |inAnyFullscreen| should 135 // Whether the controller is in any fullscreen mode. |inAnyFullscreen| should
110 // be NO if the controller is in the process of entering fullscreen. 136 // be NO if the controller is in the process of entering fullscreen.
111 - (void)setInAnyFullscreen:(BOOL)inAnyFullscreen; 137 - (void)setInAnyFullscreen:(BOOL)inAnyFullscreen;
112 - (void)setFullscreenSlidingStyle:(fullscreen_mac::SlidingStyle)slidingStyle; 138 - (void)setFullscreenSlidingStyle:(fullscreen_mac::SlidingStyle)slidingStyle;
113 - (void)setFullscreenMenubarOffset:(CGFloat)menubarOffset; 139 - (void)setFullscreenMenubarOffset:(CGFloat)menubarOffset;
114 - (void)setFullscreenToolbarFraction:(CGFloat)toolbarFraction; 140 - (void)setFullscreenToolbarFraction:(CGFloat)toolbarFraction;
115 141
116 - (void)setHasTabStrip:(BOOL)hasTabStrip; 142 - (void)setHasTabStrip:(BOOL)hasTabStrip;
143 - (void)setFullscreenButtonFrame:(NSRect)frame;
144 - (void)setShouldShowAvatar:(BOOL)shouldShowAvatar;
145 - (void)setShouldUseNewAvatar:(BOOL)shouldUseNewAvatar;
146 - (void)setAvatarSize:(NSSize)avatarSize;
147 - (void)setAvatarLineWidth:(BOOL)avatarLineWidth;
117 148
118 - (void)setHasToolbar:(BOOL)hasToolbar; 149 - (void)setHasToolbar:(BOOL)hasToolbar;
119 - (void)setHasLocationBar:(BOOL)hasLocationBar; 150 - (void)setHasLocationBar:(BOOL)hasLocationBar;
120 - (void)setToolbarHeight:(CGFloat)toolbarHeight; 151 - (void)setToolbarHeight:(CGFloat)toolbarHeight;
121 152
122 - (void)setBookmarkBarHidden:(BOOL)bookmarkBarHidden; 153 - (void)setBookmarkBarHidden:(BOOL)bookmarkBarHidden;
123 - (void)setPlaceBookmarkBarBelowInfoBar:(BOOL)placeBookmarkBarBelowInfoBar; 154 - (void)setPlaceBookmarkBarBelowInfoBar:(BOOL)placeBookmarkBarBelowInfoBar;
124 - (void)setBookmarkBarHeight:(CGFloat)bookmarkBarHeight; 155 - (void)setBookmarkBarHeight:(CGFloat)bookmarkBarHeight;
125 156
126 // The height of the info bar, not including the top arrow. 157 // The height of the info bar, not including the top arrow.
127 - (void)setInfoBarHeight:(CGFloat)infoBarHeight; 158 - (void)setInfoBarHeight:(CGFloat)infoBarHeight;
128 // The min Y of the bubble point, relative to the toolbar. 159 // The min Y of the bubble point, relative to the toolbar.
129 - (void)setPageInfoBubblePointY:(CGFloat)pageInfoBubblePointY; 160 - (void)setPageInfoBubblePointY:(CGFloat)pageInfoBubblePointY;
130 161
131 - (void)setHasDownloadShelf:(BOOL)hasDownloadShelf; 162 - (void)setHasDownloadShelf:(BOOL)hasDownloadShelf;
132 - (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight; 163 - (void)setDownloadShelfHeight:(CGFloat)downloadShelfHeight;
133 164
134 @end 165 @end
135 166
136 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_ 167 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_LAYOUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698