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

Unified Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.cc

Issue 1403413006: Distill the concept of the "tab top exclusion region", an area inside the tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@combine_background_image_getters
Patch Set: Fix indenting error Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/glass_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index 10c5958924d869bb2125d733a01d12568ffe469d..dc7d06cee88e3d7f12e6b31c9c277c36831e04fe 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -43,9 +43,9 @@ namespace {
// Size of client edge drawn inside the outer frame borders.
const int kNonClientBorderThicknessPreWin10 = 3;
const int kNonClientBorderThicknessWin10 = 1;
-// Besides the frame border, there's another 9 px of empty space atop the
-// window in restored mode, to use to drag the window around.
-const int kNonClientRestoredExtraThickness = 9;
+// Besides the frame border, there's empty space atop the window in restored
+// mode, to use to drag the window around.
+const int kNonClientRestoredExtraThickness = 11;
// In the window corners, the resize areas don't actually expand bigger, but the
// 16 px at the end of the top and bottom edges triggers diagonal resizing.
const int kResizeCornerWidth = 16;
@@ -328,13 +328,18 @@ int GlassBrowserFrameView::NonClientTopBorderHeight() const {
if (frame()->IsFullscreen())
return 0;
+ const int top = FrameTopBorderHeight();
// The tab top inset is equal to the height of any shadow region above the
// tabs, plus a 1 px top stroke. In maximized mode, we want to push the
- // shadow region off the top of the screen.
- const int tab_shadow_height = GetLayoutInsets(TAB).top() - 1;
- return FrameTopBorderHeight() +
- (frame()->IsMaximized() ?
- -tab_shadow_height : kNonClientRestoredExtraThickness);
+ // shadow region off the top of the screen but leave the top stroke.
+ // Annoyingly, the pre-MD layout uses different heights for the hit-test
+ // exclusion region (which we want here, since we're trying to size the border
+ // so that the region above the tab's hit-test zone matches) versus the shadow
+ // thickness.
+ const int exclusion = GetLayoutConstant(TAB_TOP_EXCLUSION_HEIGHT);
+ return frame()->IsMaximized() ?
+ (top - GetLayoutInsets(TAB).top() + 1) :
+ (top + kNonClientRestoredExtraThickness - exclusion);
}
void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) {
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698