Changeset 53759 in webkit


Ignore:
Timestamp:
Jan 22, 2010 9:27:40 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-22 Elliot Glaysher <erg@chromium.org>

Reviewed by David Levin.

Chromium: theme selection colors to match gtk theme
Add functions to RenderThemeChromiumLinux to change the selection color
according to the current GTK+ theme.

Since the change is to the Chromium WebKit API layer, testing is done
in Chromium's test shell (see Chromium side of this patch:
http://codereview.chromium.org/554004)

https://bugs.webkit.org/show_bug.cgi?id=33921

  • rendering/RenderThemeChromiumLinux.cpp: (WebCore::RenderThemeChromiumLinux::platformActiveSelectionBackgroundColor): (WebCore::RenderThemeChromiumLinux::platformInactiveSelectionBackgroundColor): (WebCore::RenderThemeChromiumLinux::platformActiveSelectionForegroundColor): (WebCore::RenderThemeChromiumLinux::platformInactiveSelectionForegroundColor): (WebCore::RenderThemeChromiumLinux::setSelectionColors):
  • rendering/RenderThemeChromiumLinux.h: Adds static members.

2010-01-22 Elliot Glaysher <erg@chromium.org>

Reviewed by David Levin.

Chromium: theme selection colors to match gtk theme
Add functions to RenderThemeChromiumLinux to change the selection color
according to the current GTK+ theme.

Since the change is to the Chromium WebKit API layer, testing is done
in Chromium's test shell (see Chromium side of this patch:
http://codereview.chromium.org/554004)

https://bugs.webkit.org/show_bug.cgi?id=33921

  • public/WebView.h: Adds interface to change the selection colors
  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::setSelectionColors): Implements new interface.
  • src/WebViewImpl.h:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53757 r53759  
     12010-01-22  Elliot Glaysher  <erg@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Chromium: theme selection colors to match gtk theme
     6        Add functions to RenderThemeChromiumLinux to change the selection color
     7        according to the current GTK+ theme.
     8
     9        Since the change is to the Chromium WebKit API layer, testing is done
     10        in Chromium's test shell (see Chromium side of this patch:
     11        http://codereview.chromium.org/554004)
     12
     13        https://bugs.webkit.org/show_bug.cgi?id=33921
     14
     15        * rendering/RenderThemeChromiumLinux.cpp:
     16        (WebCore::RenderThemeChromiumLinux::platformActiveSelectionBackgroundColor):
     17        (WebCore::RenderThemeChromiumLinux::platformInactiveSelectionBackgroundColor):
     18        (WebCore::RenderThemeChromiumLinux::platformActiveSelectionForegroundColor):
     19        (WebCore::RenderThemeChromiumLinux::platformInactiveSelectionForegroundColor):
     20        (WebCore::RenderThemeChromiumLinux::setSelectionColors):
     21        * rendering/RenderThemeChromiumLinux.h: Adds static members.
     22
    1232010-01-22  Kevin Watters  <kevinwatters@gmail.com>
    224
  • trunk/WebCore/rendering/RenderThemeChromiumLinux.cpp

    r51872 r53759  
    3636unsigned RenderThemeChromiumLinux::m_thumbActiveColor = 0xfaf8f5;
    3737unsigned RenderThemeChromiumLinux::m_trackColor = 0xe3ddd8;
     38unsigned RenderThemeChromiumLinux::m_activeSelectionBackgroundColor =
     39    0xff1e90ff;
     40unsigned RenderThemeChromiumLinux::m_activeSelectionForegroundColor =
     41    Color::black;
     42unsigned RenderThemeChromiumLinux::m_inactiveSelectionBackgroundColor =
     43    0xffc8c8c8;
     44unsigned RenderThemeChromiumLinux::m_inactiveSelectionForegroundColor =
     45    0xff323232;
    3846
    3947PassRefPtr<RenderTheme> RenderThemeChromiumLinux::create()
     
    97105}
    98106
     107Color RenderThemeChromiumLinux::platformActiveSelectionBackgroundColor() const
     108{
     109    return m_activeSelectionBackgroundColor;
     110}
     111
     112Color RenderThemeChromiumLinux::platformInactiveSelectionBackgroundColor() const
     113{
     114    return m_inactiveSelectionBackgroundColor;
     115}
     116
     117Color RenderThemeChromiumLinux::platformActiveSelectionForegroundColor() const
     118{
     119    return m_activeSelectionForegroundColor;
     120}
     121
     122Color RenderThemeChromiumLinux::platformInactiveSelectionForegroundColor() const
     123{
     124    return m_inactiveSelectionForegroundColor;
     125}
     126
    99127void RenderThemeChromiumLinux::adjustSliderThumbSize(RenderObject* o) const
    100128{
     
    127155}
    128156
     157void RenderThemeChromiumLinux::setSelectionColors(
     158    unsigned activeBackgroundColor,
     159    unsigned activeForegroundColor,
     160    unsigned inactiveBackgroundColor,
     161    unsigned inactiveForegroundColor)
     162{
     163    m_activeSelectionBackgroundColor = activeBackgroundColor;
     164    m_activeSelectionForegroundColor = activeForegroundColor;
     165    m_inactiveSelectionBackgroundColor = inactiveBackgroundColor;
     166    m_inactiveSelectionForegroundColor = inactiveForegroundColor;
     167}
     168
    129169void RenderThemeChromiumLinux::setScrollbarColors(
    130170    SkColor inactiveColor, SkColor activeColor, SkColor trackColor)
  • trunk/WebCore/rendering/RenderThemeChromiumLinux.h

    r51827 r53759  
    5050        virtual Color inactiveListBoxSelectionForegroundColor() const;
    5151
     52        virtual Color platformActiveSelectionBackgroundColor() const;
     53        virtual Color platformInactiveSelectionBackgroundColor() const;
     54        virtual Color platformActiveSelectionForegroundColor() const;
     55        virtual Color platformInactiveSelectionForegroundColor() const;
     56
    5257        virtual void adjustSliderThumbSize(RenderObject*) const;
    5358
    5459        void setCaretBlinkInterval(double interval);
    5560        virtual double caretBlinkIntervalInternal() const;
     61
     62        static void setSelectionColors(unsigned activeBackgroundColor,
     63                                       unsigned activeForegroundColor,
     64                                       unsigned inactiveBackgroundColor,
     65                                       unsigned inactiveForegroundColor);
    5666
    5767        static void setScrollbarColors(unsigned inactive_color,
     
    7181        double m_caretBlinkInterval;
    7282
     83        static unsigned m_activeSelectionBackgroundColor;
     84        static unsigned m_activeSelectionForegroundColor;
     85        static unsigned m_inactiveSelectionBackgroundColor;
     86        static unsigned m_inactiveSelectionForegroundColor;
     87
    7388        static unsigned m_thumbInactiveColor;
    7489        static unsigned m_thumbActiveColor;
  • trunk/WebKit/chromium/ChangeLog

    r53758 r53759  
     12010-01-22  Elliot Glaysher  <erg@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Chromium: theme selection colors to match gtk theme
     6        Add functions to RenderThemeChromiumLinux to change the selection color
     7        according to the current GTK+ theme.
     8
     9        Since the change is to the Chromium WebKit API layer, testing is done
     10        in Chromium's test shell (see Chromium side of this patch:
     11        http://codereview.chromium.org/554004)
     12
     13        https://bugs.webkit.org/show_bug.cgi?id=33921
     14
     15        * public/WebView.h: Adds interface to change the selection colors
     16        * src/WebViewImpl.cpp:
     17        (WebKit::WebViewImpl::setSelectionColors): Implements new interface.
     18        * src/WebViewImpl.h:
     19
    1202010-01-22  Steve VanDeBogart  <vandebo@chromium.org>
    221
  • trunk/WebKit/chromium/public/WebView.h

    r51874 r53759  
    252252
    253253
    254     // Scrollbar colors ----------------------------------------------------
     254    // Custom colors -------------------------------------------------------
    255255    virtual void setScrollbarColors(unsigned inactiveColor,
    256256                                    unsigned activeColor,
    257257                                    unsigned trackColor) = 0;
    258258
     259    virtual void setSelectionColors(unsigned activeBackgroundColor,
     260                                    unsigned activeForegroundColor,
     261                                    unsigned inactiveBackgroundColor,
     262                                    unsigned inactiveForegroundColor) = 0;
     263
    259264protected:
    260265    ~WebView() {}
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r53758 r53759  
    16551655}
    16561656
     1657void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor,
     1658                                     unsigned activeForegroundColor,
     1659                                     unsigned inactiveBackgroundColor,
     1660                                     unsigned inactiveForegroundColor) {
     1661#if OS(LINUX)
     1662    RenderThemeChromiumLinux::setSelectionColors(activeBackgroundColor,
     1663                                                 activeForegroundColor,
     1664                                                 inactiveBackgroundColor,
     1665                                                 inactiveForegroundColor);
     1666    theme()->platformColorsDidChange();
     1667#endif
     1668}
     1669
    16571670void WebViewImpl::didCommitLoad(bool* isNewNavigation)
    16581671{
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r53747 r53759  
    158158                                    unsigned activeColor,
    159159                                    unsigned trackColor);
     160    virtual void setSelectionColors(unsigned activeBackgroundColor,
     161                                    unsigned activeForegroundColor,
     162                                    unsigned inactiveBackgroundColor,
     163                                    unsigned inactiveForegroundColor);
    160164    virtual void performCustomContextMenuAction(unsigned action);
    161165
Note: See TracChangeset for help on using the changeset viewer.