Commit 3868029c authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Simplify GetOpaqueBorderColor() by using GetThemeProvider().

This should be non-null because this function is only called during painting,
when there should always be a widget.  The behavioral effect is that the
location bar border color should better reflect the theme toolbar color for
popup windows.  I believe when this code was originally written, popup windows
were not themed, so this wasn't necessary.

Bug: none
Change-Id: Ie4b33531cae28ce9a72c7571ebb579345fef83d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1941189
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720557}
parent 3d11aadc
......@@ -725,8 +725,7 @@ void OpaqueBrowserFrameView::PaintClientEdge(gfx::Canvas* canvas) const {
// For popup windows, draw location bar sides.
const SkColor location_bar_border_color =
browser_view()->toolbar()->location_bar()->GetOpaqueBorderColor(
browser_view()->IsIncognito());
browser_view()->toolbar()->location_bar()->GetOpaqueBorderColor();
if (!tabstrip_visible && IsToolbarVisible()) {
gfx::Rect side(client_bounds.x() - kClientEdgeThickness, y,
kClientEdgeThickness, toolbar_bounds.height());
......
......@@ -314,10 +314,10 @@ SkColor LocationBarView::GetColor(OmniboxPart part) const {
part);
}
SkColor LocationBarView::GetOpaqueBorderColor(bool incognito) const {
SkColor LocationBarView::GetOpaqueBorderColor() const {
return color_utils::GetResultingPaintColor(
GetBorderColor(), ThemeProperties::GetDefaultColor(
ThemeProperties::COLOR_TOOLBAR, incognito));
GetBorderColor(),
GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR));
}
int LocationBarView::GetBorderRadius() const {
......@@ -1006,7 +1006,7 @@ void LocationBarView::OnPaintBorder(gfx::Canvas* canvas) {
return; // The border is painted by our Background.
gfx::Rect bounds(GetContentsBounds());
const SkColor border_color = GetOpaqueBorderColor(profile_->IsOffTheRecord());
const SkColor border_color = GetOpaqueBorderColor();
canvas->DrawLine(gfx::PointF(bounds.x(), bounds.y()),
gfx::PointF(bounds.right(), bounds.y()), border_color);
canvas->DrawLine(gfx::PointF(bounds.x(), bounds.bottom() - 1),
......
......@@ -116,7 +116,7 @@ class LocationBarView : public LocationBar,
// Returns the location bar border color blended with the toolbar color.
// It's guaranteed to be opaque.
SkColor GetOpaqueBorderColor(bool incognito) const;
SkColor GetOpaqueBorderColor() const;
// Returns a background that paints an (optionally stroked) rounded rect with
// the given color.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment