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

Unified Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.cc

Issue 2381283003: Have Chrome draw top window border when using custom titlebar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
Index: chrome/browser/ui/views/frame/glass_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index 98d1063b2ea1f5353d5ccd642c28927d41fbee11..318564b86fb8cc77cd94e541da8e7157a5e5cc35 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -498,6 +498,9 @@ Windows10CaptionButton* GlassBrowserFrameView::CreateCaptionButton(
}
void GlassBrowserFrameView::PaintTitlebar(gfx::Canvas* canvas) const {
+ // This color is the same as Edge uses and closely matches the appearance of
+ // an inactive activation border.
+ SkColor inactive_border_color = 0xFFA1A1A1;
Peter Kasting 2016/10/01 05:00:14 Can't hardcode this. It works for Edge because th
Bret 2016/10/01 19:53:08 I actually think the inactive border color is fixe
Peter Kasting 2016/10/01 20:53:03 I think you're right: my normal inactive border co
SkColor frame_color = 0xFFCCCCCC;
gfx::Rect tabstrip_bounds = GetBoundsForTabStrip(browser_view()->tabstrip());
@@ -509,14 +512,15 @@ void GlassBrowserFrameView::PaintTitlebar(gfx::Canvas* canvas) const {
// BrowserDesktopWindowTreeHostWin::UpdateDWMFrame()).
const int y = IsMaximized() ? FrameTopBorderThicknessPx(false) : 1;
SkPaint paint;
+ paint.setColor(
+ ShouldPaintAsActive()
+ ? GetThemeProvider()->GetColor(ThemeProperties::COLOR_FRAME)
Bret 2016/10/01 19:53:08 This is the wrong color for the border. A good tes
Peter Kasting 2016/10/01 20:53:02 In other words: color_utils::AlphaBlend(Coloriz
Bret 2016/10/01 21:43:10 Ah yes, I never actually tried to write it into Ch
+ : inactive_border_color);
+ canvas->DrawRect(gfx::RectF(0, 0, width() * scale, y), paint);
Peter Kasting 2016/10/01 05:00:14 If we want to do this, we need justification in th
Bret 2016/10/01 19:53:08 It's definitely impossible. With the insight that
Peter Kasting 2016/10/01 20:53:03 "Have to be rewritten" like, out of scope for this
Bret 2016/10/01 21:43:10 The latter, definitely the latter.
paint.setColor(frame_color);
canvas->DrawRect(
gfx::RectF(0, y, width() * scale, tabstrip_bounds.bottom() * scale - y),
paint);
-
- // The 1 pixel line at the top is drawn by Windows when we leave that section
- // of the window blank because we have called DwmExtendFrameIntoClientArea()
- // inside BrowserDesktopWindowTreeHostWin::UpdateDWMFrame().
}
void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) const {

Powered by Google App Engine
This is Rietveld 408576698