Skip to content

Commit

Permalink
Remove LinuxUI::GetTint
Browse files Browse the repository at this point in the history
It was unused by GTK and QT.

R=thestig

Bug: None
Change-Id: I36d2a0d34c1cfbd7208e2a44ffc05ceaee0811a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3704627
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1014219}
  • Loading branch information
tanderson-google authored and Chromium LUCI CQ committed Jun 15, 2022
1 parent cdc8923 commit 83c7592
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 36 deletions.
7 changes: 1 addition & 6 deletions chrome/browser/themes/theme_service_aura_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class SystemThemeLinux : public CustomThemeSupplier {
// Overridden from CustomThemeSupplier:
void StartUsingTheme() override;
void StopUsingTheme() override;
bool GetTint(int id, color_utils::HSL* hsl) const override;
bool GetColor(int id, SkColor* color) const override;
bool GetDisplayProperty(int id, int* result) const override;
gfx::Image GetImageNamed(int id) const override;
Expand Down Expand Up @@ -57,10 +56,6 @@ void SystemThemeLinux::StopUsingTheme() {
linux_ui_->GetNativeTheme(nullptr)->NotifyOnNativeThemeUpdated();
}

bool SystemThemeLinux::GetTint(int id, color_utils::HSL* hsl) const {
return linux_ui_ && linux_ui_->GetTint(id, hsl);
}

bool SystemThemeLinux::GetColor(int id, SkColor* color) const {
return linux_ui_ && linux_ui_->GetColor(id, color,
pref_service_->GetBoolean(
Expand All @@ -79,7 +74,7 @@ bool SystemThemeLinux::HasCustomImage(int id) const {
return false;
}

SystemThemeLinux::~SystemThemeLinux() {}
SystemThemeLinux::~SystemThemeLinux() = default;

} // namespace

Expand Down
18 changes: 0 additions & 18 deletions ui/gtk/gtk_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -325,24 +325,6 @@ bool GtkUi::Initialize() {
return true;
}

bool GtkUi::GetTint(int id, color_utils::HSL* tint) const {
switch (id) {
// Tints for which the cross-platform default is fine. Before adding new
// values here, specifically verify they work well on Linux.
case ThemeProperties::TINT_BACKGROUND_TAB:
// TODO(estade): Return something useful for TINT_BUTTONS so that chrome://
// page icons are colored appropriately.
case ThemeProperties::TINT_BUTTONS:
break;
default:
// Assume any tints not specifically verified on Linux aren't usable.
// TODO(pkasting): Try to remove values from |colors_| that could just be
// added to the group above instead.
NOTREACHED();
}
return false;
}

bool GtkUi::GetColor(int id, SkColor* color, bool use_custom_frame) const {
for (const ColorMap& color_map :
{colors_,
Expand Down
1 change: 0 additions & 1 deletion ui/gtk/gtk_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class GtkUi : public views::LinuxUI {

// views::LinuxUI:
bool Initialize() override;
bool GetTint(int id, color_utils::HSL* tint) const override;
bool GetColor(int id, SkColor* color, bool use_custom_frame) const override;
bool GetDisplayProperty(int id, int* result) const override;
SkColor GetFocusRingColor() const override;
Expand Down
5 changes: 0 additions & 5 deletions ui/qt/qt_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ bool QtUi::Initialize() {
return true;
}

bool QtUi::GetTint(int id, color_utils::HSL* tint) const {
NOTIMPLEMENTED_LOG_ONCE();
return false;
}

bool QtUi::GetColor(int id, SkColor* color, bool use_custom_frame) const {
NOTIMPLEMENTED_LOG_ONCE();
return false;
Expand Down
1 change: 0 additions & 1 deletion ui/qt/qt_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class QtUi : public views::LinuxUI, QtInterface::Delegate {

// views::LinuxUI:
bool Initialize() override;
bool GetTint(int id, color_utils::HSL* tint) const override;
bool GetColor(int id, SkColor* color, bool use_custom_frame) const override;
bool GetDisplayProperty(int id, int* result) const override;
SkColor GetFocusRingColor() const override;
Expand Down
5 changes: 0 additions & 5 deletions ui/views/linux_ui/linux_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ namespace base {
class TimeDelta;
}

namespace color_utils {
struct HSL;
}

namespace gfx {
class Image;
}
Expand Down Expand Up @@ -128,7 +124,6 @@ class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMethodContextFactory,
// Returns true on success. If false is returned, this instance shouldn't
// be used and the behavior of all functions is undefined.
[[nodiscard]] virtual bool Initialize() = 0;
virtual bool GetTint(int id, color_utils::HSL* tint) const = 0;
virtual bool GetColor(int id,
SkColor* color,
bool use_custom_frame) const = 0;
Expand Down

0 comments on commit 83c7592

Please sign in to comment.