| Index: ui/views/window/frame_background.cc
|
| diff --git a/ui/views/window/frame_background.cc b/ui/views/window/frame_background.cc
|
| index 3e0e4ff5c06d71233c2a379e9973a6df3ab6e051..d325208bbd69399665cf4fcca2cc408ef32a6df1 100644
|
| --- a/ui/views/window/frame_background.cc
|
| +++ b/ui/views/window/frame_background.cc
|
| @@ -8,12 +8,14 @@
|
| #include "third_party/skia/include/core/SkColor.h"
|
| #include "ui/base/theme_provider.h"
|
| #include "ui/gfx/canvas.h"
|
| +#include "ui/native_theme/native_theme.h"
|
| #include "ui/views/view.h"
|
|
|
| namespace views {
|
|
|
| FrameBackground::FrameBackground()
|
| : frame_color_(0),
|
| + is_active_(true),
|
| top_area_height_(0),
|
| left_edge_(nullptr),
|
| top_edge_(nullptr),
|
| @@ -125,10 +127,8 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas,
|
| // beneath the image.
|
| int theme_frame_bottom = -maximized_top_inset_ +
|
| (theme_image_.isNull() ? 0 : theme_image_.height());
|
| - if (top_area_height_ > theme_frame_bottom) {
|
| - canvas->FillRect(gfx::Rect(0, 0, view->width(), top_area_height_),
|
| - frame_color_);
|
| - }
|
| + if (top_area_height_ > theme_frame_bottom)
|
| + PaintFrameTopArea(canvas, view);
|
|
|
| // Draw the theme frame.
|
| if (!theme_image_.isNull()) {
|
| @@ -142,9 +142,7 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas,
|
|
|
| void FrameBackground::PaintFrameColor(gfx::Canvas* canvas,
|
| const View* view) const {
|
| - // Fill the top area.
|
| - canvas->FillRect(gfx::Rect(0, 0, view->width(), top_area_height_),
|
| - frame_color_);
|
| + PaintFrameTopArea(canvas, view);
|
|
|
| // If the window is very short, we're done.
|
| int remaining_height = view->height() - top_area_height_;
|
| @@ -171,4 +169,16 @@ void FrameBackground::PaintFrameColor(gfx::Canvas* canvas,
|
| frame_color_);
|
| }
|
|
|
| +void FrameBackground::PaintFrameTopArea(gfx::Canvas* canvas,
|
| + const View* view) const {
|
| + auto* native_theme = view->GetNativeTheme();
|
| + ui::NativeTheme::ExtraParams params;
|
| + params.frame_top_area.is_active = is_active_;
|
| + params.frame_top_area.incognito = incognito_;
|
| + params.frame_top_area.default_background_color = frame_color_;
|
| + native_theme->Paint(canvas->sk_canvas(), ui::NativeTheme::kFrameTopArea,
|
| + ui::NativeTheme::kNormal,
|
| + gfx::Rect(0, 0, view->width(), top_area_height_), params);
|
| +}
|
| +
|
| } // namespace views
|
|
|