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

Unified Diff: ui/views/window/frame_background.cc

Issue 2628043002: Gtk3: Render a GtkHeaderBar as the background of the tab strip (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« ui/views/window/frame_background.h ('K') | « ui/views/window/frame_background.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« ui/views/window/frame_background.h ('K') | « ui/views/window/frame_background.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698