Chromium Code Reviews| 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..ab6dc571ebd138efb9768bdacdc7d7c7ba325064 100644 |
| --- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc |
| +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc |
| @@ -509,14 +509,38 @@ void GlassBrowserFrameView::PaintTitlebar(gfx::Canvas* canvas) const { |
| // BrowserDesktopWindowTreeHostWin::UpdateDWMFrame()). |
| const int y = IsMaximized() ? FrameTopBorderThicknessPx(false) : 1; |
| SkPaint paint; |
| + |
| + // Draw the top of the accent border. |
| + // |
| + // We let the DWM do this for the other sides of the window by insetting the |
| + // client area to leave nonclient area available. However, along the top |
| + // window edge, we have to have zero nonclient area or the DWM will draw a |
| + // full native titlebar outside our client area. See |
| + // BrowserDesktopWindowTreeHostWin::GetClientAreaInsets(). |
| + // |
| + // We could ask the DWM to draw the top accent border in the client area (by |
| + // calling DwmExtendFrameIntoClientArea in |
|
Peter Kasting
2016/10/11 20:01:38
Nit: Add () after function name
|
| + // BrowserDesktopWindowTreeHostWin::UpdateDWMFrame()), but this requires |
| + // that we leave part of the client surface transparent. Forcing DWM to |
| + // blend with us costs power even when it has no effect. If we draw this |
|
Peter Kasting
2016/10/11 20:01:38
Nit: What does "even when it has no effect" mean h
|
| + // ourselves, we can make the client surface fully opaque and avoid this |
| + // cost. |
| + // |
| + // So the accent border also has to be opaque, but native inactive borders |
| + // are #565656 with 80% alpha. We copy Edge (which also custom-draws its top |
| + // border) and use #A2A2A2 instead. |
| + // TODO(jbauman): Match Edge's #090909 when using the dark theme. |
|
Peter Kasting
2016/10/11 20:01:38
Which dark theme are you referring to? Chrome inc
Bret
2016/10/11 20:48:19
In Edge it's a user setting, but that's just becau
Peter Kasting
2016/10/11 20:56:51
I see.
I use a dark frame color on my own system
Bret
2016/10/11 21:10:15
I think it's somewhere between extremely difficult
|
| + constexpr SkColor inactive_border_color = 0xFFA2A2A2; |
| + paint.setColor( |
| + ShouldPaintAsActive() |
| + ? GetThemeProvider()->GetColor(ThemeProperties::COLOR_ACCENT_BORDER) |
| + : inactive_border_color); |
| + canvas->DrawRect(gfx::RectF(0, 0, width() * scale, y), paint); |
| + |
| 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 { |