Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |