forked from brave/brave-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes brave/brave-browser#22027 This regression, which caused inactive tabs under certain dark/light mode conditions on Windows to have very low contrast, was cause by the Chromium 100 change below. This fix was modelled after 5c145e9. https://chromium.googlesource.com/chromium/src/+/23a6ae6a05ef9407f56c29cbbbb133463c734099 Remove use of HasCustomColor in TabStrip and use ColorProvider. Systematized all the ChromeColorIds used for the tab strip. Bug: 1292176 Change-Id: I9dbed732cd977a184c59e45d53b918774a44799d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3425646 Reviewed-by: Peter Kasting <[email protected]> Reviewed-by: Thomas Lukaszewicz <[email protected]> Commit-Queue: Allen Bauer <[email protected]> Cr-Commit-Position: refs/heads/main@{#967904}
- Loading branch information
Showing
2 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
chromium_src/chrome/browser/ui/color/tab_strip_color_mixer.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "chrome/browser/ui/color/tab_strip_color_mixer.h" | ||
|
||
#define AddTabStripColorMixer AddTabStripColorMixer_ChromiumImpl | ||
#include "src/chrome/browser/ui/color/tab_strip_color_mixer.cc" | ||
#undef AddTabStripColorMixer | ||
|
||
namespace { | ||
|
||
const SkColor kLightToolbarIcon = SkColorSetRGB(0x42, 0x42, 0x42); | ||
|
||
void AddBraveTabStripColorMixer(ui::ColorProvider* provider, | ||
const ui::ColorProviderManager::Key& key) { | ||
ui::ColorMixer& mixer = provider->AddMixer(); | ||
|
||
// Tab text colors. | ||
if (key.color_mode == ui::ColorProviderManager::ColorMode::kDark) { | ||
mixer[kColorTabForegroundInactiveFrameActive] = {SK_ColorWHITE}; | ||
mixer[kColorTabForegroundInactiveFrameInactive] = {SK_ColorWHITE}; | ||
} else { | ||
mixer[kColorTabForegroundInactiveFrameActive] = {kLightToolbarIcon}; | ||
mixer[kColorTabForegroundInactiveFrameInactive] = {kLightToolbarIcon}; | ||
} | ||
} | ||
|
||
} // namespace | ||
|
||
void AddTabStripColorMixer(ui::ColorProvider* provider, | ||
const ui::ColorProviderManager::Key& key) { | ||
AddTabStripColorMixer_ChromiumImpl(provider, key); | ||
AddBraveTabStripColorMixer(provider, key); | ||
} |