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

Side by Side Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc

Issue 1627523002: Use the correct tabstrip height in maximized opaque frame windows in MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/profiles/profiles_state.h" 9 #include "chrome/browser/profiles/profiles_state.h"
10 #include "chrome/browser/ui/layout_constants.h" 10 #include "chrome/browser/ui/layout_constants.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 int OpaqueBrowserFrameViewLayout::NonClientTopBorderHeight( 195 int OpaqueBrowserFrameViewLayout::NonClientTopBorderHeight(
196 bool restored) const { 196 bool restored) const {
197 if (delegate_->ShouldShowWindowTitle()) { 197 if (delegate_->ShouldShowWindowTitle()) {
198 return std::max(FrameBorderThickness(restored) + delegate_->GetIconSize(), 198 return std::max(FrameBorderThickness(restored) + delegate_->GetIconSize(),
199 CaptionButtonY(restored) + kCaptionButtonHeight) + 199 CaptionButtonY(restored) + kCaptionButtonHeight) +
200 TitlebarBottomThickness(restored); 200 TitlebarBottomThickness(restored);
201 } 201 }
202 202
203 int thickness = FrameBorderThickness(restored); 203 int thickness = FrameBorderThickness(restored);
204 // The tab top inset is equal to the height of any shadow region above the
205 // tabs, plus a 1 px top stroke. In maximized mode, we want to push the
206 // shadow region off the top of the screen but leave the top stroke.
204 if (!restored && delegate_->IsTabStripVisible() && IsTitleBarCondensed()) 207 if (!restored && delegate_->IsTabStripVisible() && IsTitleBarCondensed())
205 thickness -= kTabstripTopShadowThickness; 208 thickness -= GetLayoutInsets(TAB).top() - 1;
206 return thickness; 209 return thickness;
207 } 210 }
208 211
209 int OpaqueBrowserFrameViewLayout::GetTabStripInsetsTop(bool restored) const { 212 int OpaqueBrowserFrameViewLayout::GetTabStripInsetsTop(bool restored) const {
210 const int top = NonClientTopBorderHeight(restored); 213 const int top = NonClientTopBorderHeight(restored);
211 // Annoyingly, the pre-MD layout uses different heights for the hit-test 214 // Annoyingly, the pre-MD layout uses different heights for the hit-test
212 // exclusion region (which we want here, since we're trying to size the border 215 // exclusion region (which we want here, since we're trying to size the border
213 // so that the region above the tab's hit-test zone matches) versus the shadow 216 // so that the region above the tab's hit-test zone matches) versus the shadow
214 // thickness. 217 // thickness.
215 const int exclusion = GetLayoutConstant(TAB_TOP_EXCLUSION_HEIGHT); 218 const int exclusion = GetLayoutConstant(TAB_TOP_EXCLUSION_HEIGHT);
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 664
662 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host, 665 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host,
663 views::View* view) { 666 views::View* view) {
664 SetView(view->id(), view); 667 SetView(view->id(), view);
665 } 668 }
666 669
667 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host, 670 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host,
668 views::View* view) { 671 views::View* view) {
669 SetView(view->id(), nullptr); 672 SetView(view->id(), nullptr);
670 } 673 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698