Skip to content

Commit

Permalink
Add missing context check in ChromeTypographyProvider::GetColor()
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Dec 21, 2019
1 parent ac9391b commit 1a97f22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
// Comes after the above includes.
#include "chrome/browser/ui/views/chrome_typography_provider.h"

namespace {
const SkColor kBraveGrey800 = SkColorSetRGB(0x3b, 0x3e, 0x4f);
}

#define ChromeTypographyProvider ChromeTypographyProvider_ChromiumImpl
#include "../../../../../../chrome/browser/ui/views/chrome_typography_provider.cc"
#undef ChromeTypographyProvider
Expand All @@ -24,8 +20,9 @@ SkColor ChromeTypographyProvider::GetColor(const views::View& view,
const ui::NativeTheme* native_theme = view.GetNativeTheme();
DCHECK(native_theme);
if (ShouldIgnoreHarmonySpec(*native_theme)) {
return GetHarmonyTextColorForNonStandardNativeTheme(context, style,
*native_theme);
return ChromeTypographyProvider_ChromiumImpl::GetColor(view,
context,
style);
}
// Override button text colors
if (context == views::style::CONTEXT_BUTTON_MD) {
Expand All @@ -37,7 +34,7 @@ SkColor ChromeTypographyProvider::GetColor(const views::View& view,
break;
default:
return native_theme->ShouldUseDarkColors() ? SK_ColorWHITE
: kBraveGrey800;
: gfx::kBraveGrey800;
}
}
return ChromeTypographyProvider_ChromiumImpl::GetColor(view, context, style);
Expand Down
1 change: 1 addition & 0 deletions chromium_src/ui/gfx/color_palette.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace gfx {

constexpr SkColor kBraveGrey700 = SkColorSetRGB(0x4A, 0x4A, 0x4A);
constexpr SkColor kBraveGrey800 = SkColorSetRGB(0x3b, 0x3e, 0x4f);
constexpr SkColor kBraveNeutral300 = SkColorSetRGB(0xDE, 0xE2, 0xE6);
constexpr SkColor kBraveNeutral800 = SkColorSetRGB(0x34, 0x3A, 0x40);

Expand Down

0 comments on commit 1a97f22

Please sign in to comment.