Commit 29f72f73 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[cleanup] Remove dead LayoutThemeDefault methods, and simplify switches.

LayoutThemeDefault::ActiveListBoxSelectionBackgroundColor were defined,
but not actually used as
LayoutTheme::ActiveListBoxSelectionBackgroundColor (and friends) weren't
virtual. This patch removes these unused functions.

Additional simplify some of the bool switches by:
 - Moving the default behaviour into LayoutTheme
 - Removing PopsMenuByAltDownUpOrF4Key which always returned true.

There should be no behaviour change.

Change-Id: I8b28f2b22dbf986d9d4ba3e02e8ae9c5b5c2a2cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369332Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800630}
parent cbd84a4e
...@@ -265,10 +265,8 @@ bool MenuListSelectType::ShouldOpenPopupForKeyDownEvent( ...@@ -265,10 +265,8 @@ bool MenuListSelectType::ShouldOpenPopupForKeyDownEvent(
return ((layout_theme.PopsMenuByArrowKeys() && return ((layout_theme.PopsMenuByArrowKeys() &&
(key == "ArrowDown" || key == "ArrowUp")) || (key == "ArrowDown" || key == "ArrowUp")) ||
(layout_theme.PopsMenuByAltDownUpOrF4Key() && ((key == "ArrowDown" || key == "ArrowUp") && event.altKey()) ||
(key == "ArrowDown" || key == "ArrowUp") && event.altKey()) || ((!event.altKey() && !event.ctrlKey() && key == "F4")));
(layout_theme.PopsMenuByAltDownUpOrF4Key() &&
(!event.altKey() && !event.ctrlKey() && key == "F4")));
} }
bool MenuListSelectType::ShouldOpenPopupForKeyPressEvent( bool MenuListSelectType::ShouldOpenPopupForKeyPressEvent(
......
...@@ -183,8 +183,7 @@ class CORE_EXPORT LayoutTheme : public RefCounted<LayoutTheme> { ...@@ -183,8 +183,7 @@ class CORE_EXPORT LayoutTheme : public RefCounted<LayoutTheme> {
// DelegatesMenuListRendering() always returns true. // DelegatesMenuListRendering() always returns true.
void SetDelegatesMenuListRenderingForTesting(bool flag); void SetDelegatesMenuListRenderingForTesting(bool flag);
virtual bool PopsMenuByArrowKeys() const { return false; } virtual bool PopsMenuByArrowKeys() const { return false; }
virtual bool PopsMenuByReturnKey() const { return false; } virtual bool PopsMenuByReturnKey() const { return true; }
virtual bool PopsMenuByAltDownUpOrF4Key() const { return false; }
virtual String DisplayNameForFile(const File& file) const; virtual String DisplayNameForFile(const File& file) const;
......
...@@ -115,26 +115,6 @@ String LayoutThemeDefault::ExtraQuirksStyleSheet() { ...@@ -115,26 +115,6 @@ String LayoutThemeDefault::ExtraQuirksStyleSheet() {
return UncompressResourceAsASCIIString(IDR_UASTYLE_THEME_WIN_QUIRKS_CSS); return UncompressResourceAsASCIIString(IDR_UASTYLE_THEME_WIN_QUIRKS_CSS);
} }
Color LayoutThemeDefault::ActiveListBoxSelectionBackgroundColor(
WebColorScheme color_scheme) const {
return Color(0x28, 0x28, 0x28);
}
Color LayoutThemeDefault::ActiveListBoxSelectionForegroundColor(
WebColorScheme color_scheme) const {
return color_scheme == WebColorScheme::kDark ? Color::kWhite : Color::kBlack;
}
Color LayoutThemeDefault::InactiveListBoxSelectionBackgroundColor(
WebColorScheme color_scheme) const {
return Color(0xc8, 0xc8, 0xc8);
}
Color LayoutThemeDefault::InactiveListBoxSelectionForegroundColor(
WebColorScheme color_scheme) const {
return Color(0x32, 0x32, 0x32);
}
Color LayoutThemeDefault::PlatformActiveSelectionBackgroundColor( Color LayoutThemeDefault::PlatformActiveSelectionBackgroundColor(
WebColorScheme color_scheme) const { WebColorScheme color_scheme) const {
return active_selection_background_color_; return active_selection_background_color_;
...@@ -256,10 +236,6 @@ void LayoutThemeDefault::AdjustInnerSpinButtonStyle( ...@@ -256,10 +236,6 @@ void LayoutThemeDefault::AdjustInnerSpinButtonStyle(
style.SetMinWidth(Length::Fixed(size.Width() * zoom_level)); style.SetMinWidth(Length::Fixed(size.Width() * zoom_level));
} }
bool LayoutThemeDefault::PopsMenuByReturnKey() const {
return true;
}
Color LayoutThemeDefault::PlatformFocusRingColor() const { Color LayoutThemeDefault::PlatformFocusRingColor() const {
constexpr Color focus_ring_color(0xFFE59700); constexpr Color focus_ring_color(0xFFE59700);
return focus_ring_color; return focus_ring_color;
......
...@@ -44,16 +44,6 @@ class CORE_EXPORT LayoutThemeDefault : public LayoutTheme { ...@@ -44,16 +44,6 @@ class CORE_EXPORT LayoutThemeDefault : public LayoutTheme {
Color SystemColor(CSSValueID, WebColorScheme color_scheme) const override; Color SystemColor(CSSValueID, WebColorScheme color_scheme) const override;
// List Box selection color
virtual Color ActiveListBoxSelectionBackgroundColor(
WebColorScheme color_scheme) const;
virtual Color ActiveListBoxSelectionForegroundColor(
WebColorScheme color_scheme) const;
virtual Color InactiveListBoxSelectionBackgroundColor(
WebColorScheme color_scheme) const;
virtual Color InactiveListBoxSelectionForegroundColor(
WebColorScheme color_scheme) const;
Color PlatformActiveSelectionBackgroundColor( Color PlatformActiveSelectionBackgroundColor(
WebColorScheme color_scheme) const override; WebColorScheme color_scheme) const override;
Color PlatformInactiveSelectionBackgroundColor( Color PlatformInactiveSelectionBackgroundColor(
...@@ -72,9 +62,6 @@ class CORE_EXPORT LayoutThemeDefault : public LayoutTheme { ...@@ -72,9 +62,6 @@ class CORE_EXPORT LayoutThemeDefault : public LayoutTheme {
void AdjustInnerSpinButtonStyle(ComputedStyle&) const override; void AdjustInnerSpinButtonStyle(ComputedStyle&) const override;
void AdjustButtonStyle(ComputedStyle&) const override; void AdjustButtonStyle(ComputedStyle&) const override;
bool PopsMenuByReturnKey() const override;
bool PopsMenuByAltDownUpOrF4Key() const override { return true; }
Color PlatformTapHighlightColor() const override { Color PlatformTapHighlightColor() const override {
return Color(kDefaultTapHighlightColor); return Color(kDefaultTapHighlightColor);
} }
......
...@@ -47,8 +47,8 @@ class LayoutThemeMac final : public LayoutThemeDefault { ...@@ -47,8 +47,8 @@ class LayoutThemeMac final : public LayoutThemeDefault {
Color PlatformGrammarMarkerUnderlineColor() const override; Color PlatformGrammarMarkerUnderlineColor() const override;
Color FocusRingColor() const override; Color FocusRingColor() const override;
String DisplayNameForFile(const File& file) const override; String DisplayNameForFile(const File& file) const override;
bool PopsMenuByArrowKeys() const override; bool PopsMenuByArrowKeys() const override { return true; }
bool PopsMenuByReturnKey() const override; bool PopsMenuByReturnKey() const override { return false; }
bool SupportsSelectionForegroundColors() const override { return false; } bool SupportsSelectionForegroundColors() const override { return false; }
protected: protected:
......
...@@ -129,14 +129,6 @@ bool LayoutThemeMac::UsesTestModeFocusRingColor() const { ...@@ -129,14 +129,6 @@ bool LayoutThemeMac::UsesTestModeFocusRingColor() const {
return WebTestSupport::IsRunningWebTest(); return WebTestSupport::IsRunningWebTest();
} }
bool LayoutThemeMac::PopsMenuByArrowKeys() const {
return true;
}
bool LayoutThemeMac::PopsMenuByReturnKey() const {
return false;
}
LayoutTheme& LayoutTheme::NativeTheme() { LayoutTheme& LayoutTheme::NativeTheme() {
DCHECK(features::IsFormControlsRefreshEnabled()); DCHECK(features::IsFormControlsRefreshEnabled());
DEFINE_STATIC_REF(LayoutTheme, layout_theme, (LayoutThemeMac::Create())); DEFINE_STATIC_REF(LayoutTheme, layout_theme, (LayoutThemeMac::Create()));
......
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