OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ |
7 | 7 |
8 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" | 8 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
9 #include "ui/views/layout/layout_manager.h" | 9 #include "ui/views/layout/layout_manager.h" |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // real mode. | 71 // real mode. |
72 int TitlebarBottomThickness(bool restored) const; | 72 int TitlebarBottomThickness(bool restored) const; |
73 | 73 |
74 // Returns the bounds of the titlebar icon (or where the icon would be if | 74 // Returns the bounds of the titlebar icon (or where the icon would be if |
75 // there was one). | 75 // there was one). |
76 gfx::Rect IconBounds() const; | 76 gfx::Rect IconBounds() const; |
77 | 77 |
78 // Returns the bounds of the client area for the specified view size. | 78 // Returns the bounds of the client area for the specified view size. |
79 gfx::Rect CalculateClientAreaBounds(int width, int height) const; | 79 gfx::Rect CalculateClientAreaBounds(int width, int height) const; |
80 | 80 |
| 81 void set_extra_caption_y(int extra_caption_y) { |
| 82 extra_caption_y_ = extra_caption_y; |
| 83 } |
| 84 |
| 85 void set_window_caption_spacing(int window_caption_spacing) { |
| 86 window_caption_spacing_ = window_caption_spacing; |
| 87 } |
| 88 |
81 const gfx::Rect& client_view_bounds() const { return client_view_bounds_; } | 89 const gfx::Rect& client_view_bounds() const { return client_view_bounds_; } |
82 | 90 |
83 private: | 91 private: |
84 // Whether a specific button should be inserted on the leading or trailing | 92 // Whether a specific button should be inserted on the leading or trailing |
85 // side. | 93 // side. |
86 enum ButtonAlignment { | 94 enum ButtonAlignment { |
87 ALIGN_LEADING, | 95 ALIGN_LEADING, |
88 ALIGN_TRAILING | 96 ALIGN_TRAILING |
89 }; | 97 }; |
90 | 98 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 142 |
135 // The size of the window buttons, and the avatar menu item (if any). This | 143 // The size of the window buttons, and the avatar menu item (if any). This |
136 // does not count labels or other elements that should be counted in a | 144 // does not count labels or other elements that should be counted in a |
137 // minimal frame. | 145 // minimal frame. |
138 int minimum_size_for_buttons_; | 146 int minimum_size_for_buttons_; |
139 | 147 |
140 // Whether any of the window control buttons were packed on the leading. | 148 // Whether any of the window control buttons were packed on the leading. |
141 bool has_leading_buttons_; | 149 bool has_leading_buttons_; |
142 bool has_trailing_buttons_; | 150 bool has_trailing_buttons_; |
143 | 151 |
| 152 // Extra offset from the top of the frame to the top of the window control |
| 153 // buttons. Configurable based on platform and whether we are under test. |
| 154 int extra_caption_y_; |
| 155 |
| 156 // Extra offset between the individual window caption buttons. |
| 157 int window_caption_spacing_; |
| 158 |
144 // Window controls. | 159 // Window controls. |
145 views::ImageButton* minimize_button_; | 160 views::ImageButton* minimize_button_; |
146 views::ImageButton* maximize_button_; | 161 views::ImageButton* maximize_button_; |
147 views::ImageButton* restore_button_; | 162 views::ImageButton* restore_button_; |
148 views::ImageButton* close_button_; | 163 views::ImageButton* close_button_; |
149 | 164 |
150 views::View* window_icon_; | 165 views::View* window_icon_; |
151 views::Label* window_title_; | 166 views::Label* window_title_; |
152 | 167 |
153 views::View* avatar_label_; | 168 views::View* avatar_label_; |
154 views::View* avatar_button_; | 169 views::View* avatar_button_; |
155 | 170 |
156 std::vector<ButtonID> leading_buttons_; | 171 std::vector<ButtonID> leading_buttons_; |
157 std::vector<ButtonID> trailing_buttons_; | 172 std::vector<ButtonID> trailing_buttons_; |
158 | 173 |
159 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameViewLayout); | 174 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameViewLayout); |
160 }; | 175 }; |
161 | 176 |
162 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ | 177 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ |
OLD | NEW |