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..66aafcc6dc023e11ab2e7bd3ac2c9871fbf2cb51 100644 |
--- a/ui/views/window/frame_background.cc |
+++ b/ui/views/window/frame_background.cc |
@@ -8,6 +8,7 @@ |
#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 { |
@@ -126,8 +127,7 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas, |
int theme_frame_bottom = -maximized_top_inset_ + |
(theme_image_.isNull() ? 0 : theme_image_.height()); |
if (top_area_height_ > theme_frame_bottom) { |
sky
2017/01/11 21:54:52
no {}
Tom (Use chromium acct)
2017/01/11 22:44:48
Done.
|
- canvas->FillRect(gfx::Rect(0, 0, view->width(), top_area_height_), |
- frame_color_); |
+ PaintFrameTopArea(canvas, view); |
} |
// Draw the theme frame. |
@@ -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,15 @@ 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.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 |