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

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

Issue 2741603002: Fix opaque frame popup titlebar not being painted. (Closed)
Patch Set: Created 3 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/themes/theme_properties.h" 8 #include "chrome/browser/themes/theme_properties.h"
9 #include "chrome/browser/themes/theme_service_factory.h" 9 #include "chrome/browser/themes/theme_service_factory.h"
10 #include "chrome/browser/ui/layout_constants.h" 10 #include "chrome/browser/ui/layout_constants.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // Do not show caption buttons if the window manager is forcefully providing a 503 // Do not show caption buttons if the window manager is forcefully providing a
504 // title bar (e.g., in Ubuntu Unity, if the window is maximized). 504 // title bar (e.g., in Ubuntu Unity, if the window is maximized).
505 if (!views::ViewsDelegate::GetInstance()) 505 if (!views::ViewsDelegate::GetInstance())
506 return true; 506 return true;
507 return !views::ViewsDelegate::GetInstance()->WindowManagerProvidesTitleBar( 507 return !views::ViewsDelegate::GetInstance()->WindowManagerProvidesTitleBar(
508 IsMaximized()); 508 IsMaximized());
509 } 509 }
510 510
511 int OpaqueBrowserFrameView::GetTopAreaHeight() const { 511 int OpaqueBrowserFrameView::GetTopAreaHeight() const {
512 const gfx::ImageSkia frame_image = GetFrameImage(); 512 const gfx::ImageSkia frame_image = GetFrameImage();
513 int top_area_height = frame_image.height(); // Returns 0 if isNull(). 513 int top_area_height = frame_image.isNull()
514 ? layout_->NonClientTopHeight(false)
Bret 2017/03/09 01:18:26 this "false" is "calculate for restored"... it loo
Peter Kasting 2017/03/09 05:27:06 I think maybe this should be std::max(frame_image.
Bret 2017/03/09 21:47:49 You're right, that's probably safer. Done.
515 : frame_image.height();
514 if (browser_view()->IsTabStripVisible()) { 516 if (browser_view()->IsTabStripVisible()) {
515 top_area_height = 517 top_area_height =
516 std::max(top_area_height, 518 std::max(top_area_height,
517 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); 519 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom());
518 } 520 }
519 return top_area_height; 521 return top_area_height;
520 } 522 }
521 523
522 void OpaqueBrowserFrameView::PaintRestoredFrameBorder( 524 void OpaqueBrowserFrameView::PaintRestoredFrameBorder(
523 gfx::Canvas* canvas) const { 525 gfx::Canvas* canvas) const {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 gfx::Rect side(x, y, kClientEdgeThickness, h); 666 gfx::Rect side(x, y, kClientEdgeThickness, h);
665 canvas->FillRect(side, color); 667 canvas->FillRect(side, color);
666 if (draw_bottom) { 668 if (draw_bottom) {
667 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), 669 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness),
668 kClientEdgeThickness), 670 kClientEdgeThickness),
669 color); 671 color);
670 } 672 }
671 side.Offset(w + kClientEdgeThickness, 0); 673 side.Offset(w + kClientEdgeThickness, 0);
672 canvas->FillRect(side, color); 674 canvas->FillRect(side, color);
673 } 675 }
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