2 * This file is part of the WebKit project.
4 * Copyright (C) 2006 Apple Computer, Inc.
5 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
6 * Copyright (C) 2007 Holger Hans Peter Freyther
7 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
8 * Copyright (C) 2008, 2009 Google, Inc.
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
28 #ifndef RenderThemeChromiumSkia_h
29 #define RenderThemeChromiumSkia_h
31 #include "RenderTheme.h"
32 #include "RenderThemeChromiumCommon.h"
38 class RenderThemeChromiumSkia : public RenderTheme {
40 RenderThemeChromiumSkia();
41 virtual ~RenderThemeChromiumSkia();
43 virtual String extraDefaultStyleSheet();
44 virtual String extraQuirksStyleSheet();
46 virtual String extraMediaControlsStyleSheet();
49 // A method asking if the theme's controls actually care about redrawing when hovered.
50 virtual bool supportsHover(const RenderStyle*) const;
52 // A method asking if the theme is able to draw the focus ring.
53 virtual bool supportsFocusRing(const RenderStyle*) const;
55 virtual bool supportsDataListUI(const AtomicString& type) const OVERRIDE;
57 // The platform selection color.
58 virtual Color platformActiveSelectionBackgroundColor() const;
59 virtual Color platformInactiveSelectionBackgroundColor() const;
60 virtual Color platformActiveSelectionForegroundColor() const;
61 virtual Color platformInactiveSelectionForegroundColor() const;
62 virtual Color platformFocusRingColor() const;
64 // To change the blink interval, override caretBlinkIntervalInternal instead of this one so that we may share layout test code an intercepts.
65 virtual double caretBlinkInterval() const;
68 virtual void systemFont(int propId, FontDescription&) const;
70 virtual int minimumMenuListSize(RenderStyle*) const;
72 virtual void setCheckboxSize(RenderStyle*) const;
74 virtual void setRadioSize(RenderStyle*) const;
76 virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
78 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
80 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
81 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
83 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
84 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
86 virtual void adjustSearchFieldDecorationStyle(StyleResolver*, RenderStyle*, Element*) const;
88 virtual void adjustSearchFieldResultsDecorationStyle(StyleResolver*, RenderStyle*, Element*) const;
89 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&);
91 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
92 virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
94 virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&);
95 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
96 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
97 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
98 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
99 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
100 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
101 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&);
103 // MenuList refers to an unstyled menulist (meaning a menulist without
104 // background-color or border set) and MenuListButton refers to a styled
105 // menulist (a menulist with background-color or border set). They have
106 // this distinction to support showing aqua style themes whenever they
107 // possibly can, which is something we don't want to replicate.
109 // In short, we either go down the MenuList code path or the MenuListButton
110 // codepath. We never go down both. And in both cases, they render the
112 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
113 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
114 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
116 #if ENABLE(PROGRESS_TAG)
117 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
118 virtual double animationDurationForProgressBar(RenderProgress*) const;
121 // These methods define the padding for the MenuList's inner block.
122 virtual int popupInternalPaddingLeft(RenderStyle*) const;
123 virtual int popupInternalPaddingRight(RenderStyle*) const;
124 virtual int popupInternalPaddingTop(RenderStyle*) const;
125 virtual int popupInternalPaddingBottom(RenderStyle*) const;
129 virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true; }
130 virtual bool usesVerticalVolumeSlider() const { return false; }
133 // Provide a way to pass the default font size from the Settings object
134 // to the render theme. FIXME: http://b/1129186 A cleaner way would be
135 // to remove the default font size from this object and have callers
136 // that need the value to get it directly from the appropriate Settings
138 static void setDefaultFontSize(int);
141 static const String& defaultGUIFont();
143 // The default variable-width font size. We use this as the default font
144 // size for the "system font", and as a base size (which we then shrink) for
145 // form control fonts.
146 static float defaultFontSize;
148 virtual double caretBlinkIntervalInternal() const;
150 virtual int menuListArrowPadding() const;
152 static void setSizeIfAuto(RenderStyle*, const IntSize&);
154 #if ENABLE(PROGRESS_TAG)
155 IntRect determinateProgressValueRectFor(RenderProgress*, const IntRect&) const;
156 IntRect indeterminateProgressValueRectFor(RenderProgress*, const IntRect&) const;
157 IntRect progressValueRectFor(RenderProgress*, const IntRect&) const;
161 virtual Color disabledTextColor(const Color& textColor, const Color&) const OVERRIDE { return textColor; }
162 virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE;
164 int menuListInternalPadding(RenderStyle*, int paddingType) const;
165 bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);
166 IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localOffset) const;
169 } // namespace WebCore
171 #endif // RenderThemeChromiumSkia_h