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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 2255313004: Fix the toolbar bottom border being 2 pixels w/ a detached bookmark bar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 tp->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND)); 230 tp->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND));
231 canvas->FillRect( 231 canvas->FillRect(
232 fill_rect, 232 fill_rect,
233 tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND)); 233 tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND));
234 234
235 // Draw the separators above and below bookmark bar; 235 // Draw the separators above and below bookmark bar;
236 // if animating, these are fading in/out. 236 // if animating, these are fading in/out.
237 SkColor separator_color = 237 SkColor separator_color =
238 tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); 238 tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR);
239 239
240 if (ui::MaterialDesignController::IsModeMaterial()) { 240 // In material mode the toolbar bottom stroke serves as our top stroke.
241 BrowserView::Paint1pxHorizontalLine( 241 if (!ui::MaterialDesignController::IsModeMaterial())
242 canvas, separator_color,
243 gfx::Rect(0, 0, view->width(),
244 views::NonClientFrameView::kClientEdgeThickness),
245 true);
246 } else {
247 PaintHorizontalBorder(canvas, view, true, separator_color); 242 PaintHorizontalBorder(canvas, view, true, separator_color);
248 }
249 243
250 // For the bottom separator, increase the luminance. Either double it or halve 244 // For the bottom separator, increase the luminance. Either double it or halve
251 // the distance to 1.0, whichever is less of a difference. 245 // the distance to 1.0, whichever is less of a difference.
252 color_utils::HSL hsl; 246 color_utils::HSL hsl;
253 color_utils::SkColorToHSL(separator_color, &hsl); 247 color_utils::SkColorToHSL(separator_color, &hsl);
254 hsl.l = std::min((hsl.l + 1) / 2, hsl.l * 2); 248 hsl.l = std::min((hsl.l + 1) / 2, hsl.l * 2);
255 BrowserView::Paint1pxHorizontalLine( 249 BrowserView::Paint1pxHorizontalLine(
256 canvas, color_utils::HSLToSkColor(hsl, SK_AlphaOPAQUE), 250 canvas, color_utils::HSLToSkColor(hsl, SK_AlphaOPAQUE),
257 view->GetLocalBounds(), true); 251 view->GetLocalBounds(), true);
258 } 252 }
(...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after
2662 } 2656 }
2663 2657
2664 extensions::ActiveTabPermissionGranter* 2658 extensions::ActiveTabPermissionGranter*
2665 BrowserView::GetActiveTabPermissionGranter() { 2659 BrowserView::GetActiveTabPermissionGranter() {
2666 content::WebContents* web_contents = GetActiveWebContents(); 2660 content::WebContents* web_contents = GetActiveWebContents();
2667 if (!web_contents) 2661 if (!web_contents)
2668 return nullptr; 2662 return nullptr;
2669 return extensions::TabHelper::FromWebContents(web_contents) 2663 return extensions::TabHelper::FromWebContents(web_contents)
2670 ->active_tab_permission_granter(); 2664 ->active_tab_permission_granter();
2671 } 2665 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698