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 text color of the download shelf buttons.
Fixes brave/brave-browser#20210 Chromium 97 change that caused this regression: https://chromium.googlesource.com/chromium/src/+/4f653fca62670389f2d13571d1f64ddc34b5d88c commit 4f653fca62670389f2d13571d1f64ddc34b5d88c Author: Allen Bauer <[email protected]> Date: Mon Oct 18 21:02:26 2021 +0000 Remove HasCustomColor from DownloadShelfView code. This also pushes the calculation of the colors into the ThemeHelper. It will slightly change the themed color calculations while keeping the colors the same for non-themed cases. Provided ColorProvider color mapping and calculation recipes. Bug: 1056953
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 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
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
31 changes: 31 additions & 0 deletions
31
chromium_src/chrome/browser/ui/color/chrome_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,31 @@ | ||
/* Copyright (c) 2021 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/chrome_color_mixer.h" | ||
|
||
#define AddChromeColorMixer AddChromeColorMixer_ChromiumImpl | ||
#include "src/chrome/browser/ui/color/chrome_color_mixer.cc" | ||
#undef AddChromeColorMixer | ||
|
||
namespace { | ||
|
||
void AddBraveColorMixer(ui::ColorProvider* provider, | ||
const ui::ColorProviderManager::Key& key) { | ||
const bool dark_mode = | ||
key.color_mode == ui::ColorProviderManager::ColorMode::kDark; | ||
ui::ColorMixer& mixer = provider->AddMixer(); | ||
|
||
// Download shelf colors. | ||
mixer[kColorDownloadShelfButtonText] = {dark_mode ? SK_ColorWHITE | ||
: gfx::kBraveGrey800}; | ||
} | ||
|
||
} // namespace | ||
|
||
void AddChromeColorMixer(ui::ColorProvider* provider, | ||
const ui::ColorProviderManager::Key& key) { | ||
AddChromeColorMixer_ChromiumImpl(provider, key); | ||
AddBraveColorMixer(provider, key); | ||
} |