-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed inactive tab color is unreadable with accent color
fix brave/brave-browser#22027 As we don't use accent color for title bar, tab color should not be affected also by accent color. Fixed by preventing Windows' accent color affect frame colors.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
chromium_src/chrome/browser/ui/color/win/native_chrome_color_mixer_win.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,44 @@ | ||
/* 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 "base/callback_list.h" | ||
#include "base/no_destructor.h" | ||
#include "third_party/abseil-cpp/absl/types/optional.h" | ||
#include "third_party/skia/include/core/SkColor.h" | ||
#include "ui/color/win/accent_color_observer.h" | ||
|
||
namespace ui { | ||
|
||
class FakeAccentColorObserver { | ||
public: | ||
static FakeAccentColorObserver* Get() { | ||
static base::NoDestructor<FakeAccentColorObserver> observer; | ||
return observer.get(); | ||
} | ||
|
||
FakeAccentColorObserver() {} | ||
FakeAccentColorObserver(const FakeAccentColorObserver&) = delete; | ||
FakeAccentColorObserver& operator=(const FakeAccentColorObserver&) = delete; | ||
~FakeAccentColorObserver() {} | ||
|
||
base::CallbackListSubscription Subscribe(base::RepeatingClosure callback) { | ||
return callbacks_.Add(std::move(callback)); | ||
} | ||
|
||
absl::optional<SkColor> accent_color() const { return absl::nullopt; } | ||
absl::optional<SkColor> accent_color_inactive() const { | ||
return absl::nullopt; | ||
} | ||
absl::optional<SkColor> accent_border_color() const { return absl::nullopt; } | ||
|
||
private: | ||
base::RepeatingClosureList callbacks_; | ||
}; | ||
|
||
} // namespace ui | ||
|
||
#define AccentColorObserver FakeAccentColorObserver | ||
#include "src/chrome/browser/ui/color/win/native_chrome_color_mixer_win.cc" | ||
#undef AccentColorObserver |