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

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: use max 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 =
514 std::max(frame_image.height(), layout_->NonClientTopHeight(false));
514 if (browser_view()->IsTabStripVisible()) { 515 if (browser_view()->IsTabStripVisible()) {
515 top_area_height = 516 top_area_height =
516 std::max(top_area_height, 517 std::max(top_area_height,
517 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); 518 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom());
518 } 519 }
519 return top_area_height; 520 return top_area_height;
520 } 521 }
521 522
522 void OpaqueBrowserFrameView::PaintRestoredFrameBorder( 523 void OpaqueBrowserFrameView::PaintRestoredFrameBorder(
523 gfx::Canvas* canvas) const { 524 gfx::Canvas* canvas) const {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 gfx::Rect side(x, y, kClientEdgeThickness, h); 665 gfx::Rect side(x, y, kClientEdgeThickness, h);
665 canvas->FillRect(side, color); 666 canvas->FillRect(side, color);
666 if (draw_bottom) { 667 if (draw_bottom) {
667 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), 668 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness),
668 kClientEdgeThickness), 669 kClientEdgeThickness),
669 color); 670 color);
670 } 671 }
671 side.Offset(w + kClientEdgeThickness, 0); 672 side.Offset(w + kClientEdgeThickness, 0);
672 canvas->FillRect(side, color); 673 canvas->FillRect(side, color);
673 } 674 }
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