Commit ca740c83 authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Dark mode odds and ends

This should cover:
- Infobar
- Detached bookmark bar
- Avatar menu text (but not icons yet)
- Default bookmark icon
- Toolbar buttons
- Secondary UI controls

Bug: 850098
Change-Id: I6583f06e9470e320826f766e18d9c6e9141b75fa
Reviewed-on: https://chromium-review.googlesource.com/c/1337793
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609010}
parent a1d88aae
......@@ -43,6 +43,7 @@ base::Optional<SkColor> GetDarkModeColor(int id) {
case ThemeProperties::COLOR_NTP_TEXT:
return SK_ColorWHITE;
case ThemeProperties::COLOR_TOOLBAR:
case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND:
return SkColorSetRGB(0x41, 0x41, 0x41);
case ThemeProperties::COLOR_FRAME:
case ThemeProperties::COLOR_BACKGROUND_TAB:
......@@ -53,6 +54,9 @@ base::Optional<SkColor> GetDarkModeColor(int id) {
return SK_ColorBLACK;
case ThemeProperties::COLOR_BUTTON_BACKGROUND:
return SkColorSetARGB(0xE5, 0x41, 0x41, 0x41);
case ThemeProperties::COLOR_FRAME_INACTIVE:
case ThemeProperties::COLOR_BACKGROUND_TAB_INACTIVE:
return gfx::kGoogleGrey800;
default:
return base::nullopt;
}
......@@ -169,7 +173,11 @@ color_utils::HSL ThemeProperties::GetDefaultTint(int id, bool incognito) {
DCHECK(id != TINT_FRAME_INCOGNITO && id != TINT_FRAME_INCOGNITO_INACTIVE)
<< "These values should be queried via their respective non-incognito "
"equivalents and an appropriate |incognito| value.";
if (!incognito &&
ui::NativeTheme::GetInstanceForNativeUi()->SystemDarkModeEnabled() &&
id == TINT_BUTTONS) {
return {0, 0, 1};
}
// If you change these defaults, you must increment the version number in
// browser_theme_pack.cc.
if (incognito) {
......
......@@ -18,6 +18,22 @@ namespace ui {
SkColor GetAuraColor(NativeTheme::ColorId color_id,
const NativeTheme* base_theme) {
// TODO(lgrey): High contrast dark mode.
if (base_theme->SystemDarkModeEnabled()) {
switch (color_id) {
case NativeTheme::kColorId_LabelEnabledColor:
case NativeTheme::kColorId_TextfieldDefaultColor:
return SK_ColorWHITE;
case NativeTheme::kColorId_UnfocusedBorderColor:
return gfx::kGoogleGrey900;
case NativeTheme::kColorId_ButtonEnabledColor:
case NativeTheme::kColorId_ButtonHoverColor:
return gfx::kGoogleGrey200;
default:
break;
}
}
// High contrast overrides the normal colors for certain ColorIds to be much
// darker or lighter.
if (base_theme->UsesHighContrastColors()) {
......
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