diff options
author | Ben Murdoch <benm@google.com> | 2009-08-11 17:01:47 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2009-08-11 18:21:02 +0100 |
commit | 0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch) | |
tree | 2943df35f62d885c89d01063cc528dd73b480fea /WebCore/rendering/RenderTheme.h | |
parent | 7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff) | |
download | external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2 |
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/rendering/RenderTheme.h')
-rw-r--r-- | WebCore/rendering/RenderTheme.h | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/WebCore/rendering/RenderTheme.h b/WebCore/rendering/RenderTheme.h index 450e2f6..4f37015 100644 --- a/WebCore/rendering/RenderTheme.h +++ b/WebCore/rendering/RenderTheme.h @@ -23,13 +23,16 @@ #ifndef RenderTheme_h #define RenderTheme_h -#include "RenderObject.h" #if USE(NEW_THEME) #include "Theme.h" #else #include "ThemeTypes.h" #endif +#include "RenderObject.h" +#include "RenderTheme.h" #include "ScrollTypes.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> namespace WebCore { @@ -38,11 +41,24 @@ class PopupMenu; class RenderMenuList; class CSSStyleSheet; -class RenderTheme { -public: +class RenderTheme : public RefCounted<RenderTheme> { +protected: RenderTheme(); + +public: virtual ~RenderTheme() { } + // This function is to be implemented in your platform-specific theme implementation to hand back the + // appropriate platform theme. When the theme is needed in non-page dependent code, a default theme is + // used as fallback, which is returned for a nulled page, so the platform code needs to account for this. + static PassRefPtr<RenderTheme> themeForPage(Page* page); + + // When the theme is needed in non-page dependent code, the defaultTheme() is used as fallback. + static inline PassRefPtr<RenderTheme> defaultTheme() + { + return themeForPage(0); + }; + // This method is called whenever style has been computed for an element and the appearance // property has been set to a value other than "none". The theme should map in all of the appropriate // metrics and defaults given the contents of the style. This includes sophisticated operations like @@ -62,7 +78,7 @@ public: // RenderThemeMac.cpp for Mac OS X. // These methods return the theme's extra style sheets rules, to let each platform - // adjust the default CSS rules in html4.css, quirks.css, or mediaControls.css + // adjust the default CSS rules in html.css, quirks.css, or mediaControls.css virtual String extraDefaultStyleSheet() { return String(); } virtual String extraQuirksStyleSheet() { return String(); } #if ENABLE(VIDEO) @@ -121,6 +137,10 @@ public: virtual Color platformActiveTextSearchHighlightColor() const; virtual Color platformInactiveTextSearchHighlightColor() const; + static Color focusRingColor(); + virtual Color platformFocusRingColor() const { return Color(0, 0, 0); } + static void setCustomFocusRingColor(const Color&); + virtual void platformColorsDidChange(); virtual double caretBlinkInterval() const { return 0.5; } @@ -227,7 +247,9 @@ protected: virtual bool paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } virtual bool paintMediaSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } - virtual bool paintMediaTimelineContainer(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } + virtual bool paintMediaRewindButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } + virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } + virtual bool paintMediaControlsBackground(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } virtual bool paintMediaCurrentTime(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } virtual bool paintMediaTimeRemaining(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; } @@ -260,10 +282,6 @@ private: #endif }; -// Function to obtain the theme. This is implemented in your platform-specific theme implementation to hand -// back the appropriate platform theme. -RenderTheme* theme(); - } // namespace WebCore #endif // RenderTheme_h |