OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the WebKit project. | 2 * This file is part of the WebKit project. |
3 * | 3 * |
4 * Copyright (C) 2006 Apple Computer, Inc. | 4 * Copyright (C) 2006 Apple Computer, Inc. |
5 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com | 5 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com |
6 * Copyright (C) 2007 Holger Hans Peter Freyther | 6 * Copyright (C) 2007 Holger Hans Peter Freyther |
7 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 7 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
8 * Copyright (C) 2008, 2009 Google, Inc. | 8 * Copyright (C) 2008, 2009 Google, Inc. |
9 * All rights reserved. | 9 * All rights reserved. |
10 * Copyright (C) 2009 Kenneth Rohde Christiansen | 10 * Copyright (C) 2009 Kenneth Rohde Christiansen |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class LayoutProgress; | 36 class LayoutProgress; |
37 | 37 |
38 class LayoutThemeDefault : public LayoutTheme { | 38 class LayoutThemeDefault : public LayoutTheme { |
39 public: | 39 public: |
40 virtual String extraDefaultStyleSheet() override; | 40 virtual String extraDefaultStyleSheet() override; |
41 virtual String extraQuirksStyleSheet() override; | 41 virtual String extraQuirksStyleSheet() override; |
42 | 42 |
43 virtual Color systemColor(CSSValueID) const override; | 43 virtual Color systemColor(CSSValueID) const override; |
44 | 44 |
45 virtual bool supportsFocusRing(const LayoutStyle&) const override; | 45 virtual bool supportsFocusRing(const ComputedStyle&) const override; |
46 | 46 |
47 // List Box selection color | 47 // List Box selection color |
48 virtual Color activeListBoxSelectionBackgroundColor() const; | 48 virtual Color activeListBoxSelectionBackgroundColor() const; |
49 virtual Color activeListBoxSelectionForegroundColor() const; | 49 virtual Color activeListBoxSelectionForegroundColor() const; |
50 virtual Color inactiveListBoxSelectionBackgroundColor() const; | 50 virtual Color inactiveListBoxSelectionBackgroundColor() const; |
51 virtual Color inactiveListBoxSelectionForegroundColor() const; | 51 virtual Color inactiveListBoxSelectionForegroundColor() const; |
52 | 52 |
53 virtual Color platformActiveSelectionBackgroundColor() const override; | 53 virtual Color platformActiveSelectionBackgroundColor() const override; |
54 virtual Color platformInactiveSelectionBackgroundColor() const override; | 54 virtual Color platformInactiveSelectionBackgroundColor() const override; |
55 virtual Color platformActiveSelectionForegroundColor() const override; | 55 virtual Color platformActiveSelectionForegroundColor() const override; |
56 virtual Color platformInactiveSelectionForegroundColor() const override; | 56 virtual Color platformInactiveSelectionForegroundColor() const override; |
57 | 57 |
58 virtual IntSize sliderTickSize() const override; | 58 virtual IntSize sliderTickSize() const override; |
59 virtual int sliderTickOffsetFromTrackCenter() const override; | 59 virtual int sliderTickOffsetFromTrackCenter() const override; |
60 virtual void adjustSliderThumbSize(LayoutStyle&, Element*) const override; | 60 virtual void adjustSliderThumbSize(ComputedStyle&, Element*) const override; |
61 | 61 |
62 static void setCaretBlinkInterval(double); | 62 static void setCaretBlinkInterval(double); |
63 | 63 |
64 virtual bool paintCheckbox(LayoutObject*, const PaintInfo&, const IntRect&)
override; | 64 virtual bool paintCheckbox(LayoutObject*, const PaintInfo&, const IntRect&)
override; |
65 virtual void setCheckboxSize(LayoutStyle&) const override; | 65 virtual void setCheckboxSize(ComputedStyle&) const override; |
66 | 66 |
67 virtual bool paintRadio(LayoutObject*, const PaintInfo&, const IntRect&) ove
rride; | 67 virtual bool paintRadio(LayoutObject*, const PaintInfo&, const IntRect&) ove
rride; |
68 virtual void setRadioSize(LayoutStyle&) const override; | 68 virtual void setRadioSize(ComputedStyle&) const override; |
69 | 69 |
70 virtual bool paintButton(LayoutObject*, const PaintInfo&, const IntRect&) ov
erride; | 70 virtual bool paintButton(LayoutObject*, const PaintInfo&, const IntRect&) ov
erride; |
71 virtual bool paintTextField(LayoutObject*, const PaintInfo&, const IntRect&)
override; | 71 virtual bool paintTextField(LayoutObject*, const PaintInfo&, const IntRect&)
override; |
72 virtual bool paintMenuList(LayoutObject*, const PaintInfo&, const IntRect&)
override; | 72 virtual bool paintMenuList(LayoutObject*, const PaintInfo&, const IntRect&)
override; |
73 virtual bool paintMenuListButton(LayoutObject*, const PaintInfo&, const IntR
ect&) override; | 73 virtual bool paintMenuListButton(LayoutObject*, const PaintInfo&, const IntR
ect&) override; |
74 virtual bool paintSliderTrack(LayoutObject*, const PaintInfo&, const IntRect
&) override; | 74 virtual bool paintSliderTrack(LayoutObject*, const PaintInfo&, const IntRect
&) override; |
75 virtual bool paintSliderThumb(LayoutObject*, const PaintInfo&, const IntRect
&) override; | 75 virtual bool paintSliderThumb(LayoutObject*, const PaintInfo&, const IntRect
&) override; |
76 | 76 |
77 virtual void adjustInnerSpinButtonStyle(LayoutStyle&, Element*) const overri
de; | 77 virtual void adjustInnerSpinButtonStyle(ComputedStyle&, Element*) const over
ride; |
78 virtual bool paintInnerSpinButton(LayoutObject*, const PaintInfo&, const Int
Rect&) override; | 78 virtual bool paintInnerSpinButton(LayoutObject*, const PaintInfo&, const Int
Rect&) override; |
79 | 79 |
80 virtual bool popsMenuBySpaceKey() const override final { return true; } | 80 virtual bool popsMenuBySpaceKey() const override final { return true; } |
81 virtual bool popsMenuByReturnKey() const override final { return true; } | 81 virtual bool popsMenuByReturnKey() const override final { return true; } |
82 virtual bool popsMenuByAltDownUpOrF4Key() const override { return true; } | 82 virtual bool popsMenuByAltDownUpOrF4Key() const override { return true; } |
83 | 83 |
84 virtual bool paintProgressBar(LayoutObject*, const PaintInfo&, const IntRect
&) override; | 84 virtual bool paintProgressBar(LayoutObject*, const PaintInfo&, const IntRect
&) override; |
85 | 85 |
86 virtual bool shouldOpenPickerWithF4Key() const override; | 86 virtual bool shouldOpenPickerWithF4Key() const override; |
87 | 87 |
88 virtual Color platformTapHighlightColor() const override | 88 virtual Color platformTapHighlightColor() const override |
89 { | 89 { |
90 return Color(defaultTapHighlightColor); | 90 return Color(defaultTapHighlightColor); |
91 } | 91 } |
92 | 92 |
93 // A method asking if the theme's controls actually care about redrawing | 93 // A method asking if the theme's controls actually care about redrawing |
94 // when hovered. | 94 // when hovered. |
95 virtual bool supportsHover(const LayoutStyle&) const override final; | 95 virtual bool supportsHover(const ComputedStyle&) const override final; |
96 | 96 |
97 virtual Color platformFocusRingColor() const override; | 97 virtual Color platformFocusRingColor() const override; |
98 | 98 |
99 virtual double caretBlinkInterval() const final; | 99 virtual double caretBlinkInterval() const final; |
100 | 100 |
101 // System fonts. | 101 // System fonts. |
102 virtual void systemFont(CSSValueID systemFontID, FontStyle&, FontWeight&, fl
oat& fontSize, AtomicString& fontFamily) const; | 102 virtual void systemFont(CSSValueID systemFontID, FontStyle&, FontWeight&, fl
oat& fontSize, AtomicString& fontFamily) const; |
103 | 103 |
104 virtual int minimumMenuListSize(const LayoutStyle&) const override; | 104 virtual int minimumMenuListSize(const ComputedStyle&) const override; |
105 | 105 |
106 virtual void adjustButtonStyle(LayoutStyle&, Element*) const override; | 106 virtual void adjustButtonStyle(ComputedStyle&, Element*) const override; |
107 | 107 |
108 virtual bool paintTextArea(LayoutObject*, const PaintInfo&, const IntRect&)
override; | 108 virtual bool paintTextArea(LayoutObject*, const PaintInfo&, const IntRect&)
override; |
109 | 109 |
110 virtual void adjustSearchFieldStyle(LayoutStyle&, Element*) const override; | 110 virtual void adjustSearchFieldStyle(ComputedStyle&, Element*) const override
; |
111 virtual bool paintSearchField(LayoutObject*, const PaintInfo&, const IntRect
&) override; | 111 virtual bool paintSearchField(LayoutObject*, const PaintInfo&, const IntRect
&) override; |
112 | 112 |
113 virtual void adjustSearchFieldCancelButtonStyle(LayoutStyle&, Element*) cons
t override; | 113 virtual void adjustSearchFieldCancelButtonStyle(ComputedStyle&, Element*) co
nst override; |
114 virtual bool paintSearchFieldCancelButton(LayoutObject*, const PaintInfo&, c
onst IntRect&) override; | 114 virtual bool paintSearchFieldCancelButton(LayoutObject*, const PaintInfo&, c
onst IntRect&) override; |
115 | 115 |
116 virtual void adjustSearchFieldDecorationStyle(LayoutStyle&, Element*) const
override; | 116 virtual void adjustSearchFieldDecorationStyle(ComputedStyle&, Element*) cons
t override; |
117 | 117 |
118 virtual void adjustSearchFieldResultsDecorationStyle(LayoutStyle&, Element*)
const override; | 118 virtual void adjustSearchFieldResultsDecorationStyle(ComputedStyle&, Element
*) const override; |
119 virtual bool paintSearchFieldResultsDecoration(LayoutObject*, const PaintInf
o&, const IntRect&) override; | 119 virtual bool paintSearchFieldResultsDecoration(LayoutObject*, const PaintInf
o&, const IntRect&) override; |
120 | 120 |
121 virtual bool paintMediaSliderTrack(LayoutObject*, const PaintInfo&, const In
tRect&) override; | 121 virtual bool paintMediaSliderTrack(LayoutObject*, const PaintInfo&, const In
tRect&) override; |
122 virtual bool paintMediaVolumeSliderTrack(LayoutObject*, const PaintInfo&, co
nst IntRect&) override; | 122 virtual bool paintMediaVolumeSliderTrack(LayoutObject*, const PaintInfo&, co
nst IntRect&) override; |
123 virtual bool paintMediaSliderThumb(LayoutObject*, const PaintInfo&, const In
tRect&) override; | 123 virtual bool paintMediaSliderThumb(LayoutObject*, const PaintInfo&, const In
tRect&) override; |
124 virtual bool paintMediaToggleClosedCaptionsButton(LayoutObject*, const Paint
Info&, const IntRect&) override; | 124 virtual bool paintMediaToggleClosedCaptionsButton(LayoutObject*, const Paint
Info&, const IntRect&) override; |
125 virtual bool paintMediaCastButton(LayoutObject*, const PaintInfo&, const Int
Rect&) override; | 125 virtual bool paintMediaCastButton(LayoutObject*, const PaintInfo&, const Int
Rect&) override; |
126 virtual bool paintMediaVolumeSliderThumb(LayoutObject*, const PaintInfo&, co
nst IntRect&) override; | 126 virtual bool paintMediaVolumeSliderThumb(LayoutObject*, const PaintInfo&, co
nst IntRect&) override; |
127 virtual bool paintMediaPlayButton(LayoutObject*, const PaintInfo&, const Int
Rect&) override; | 127 virtual bool paintMediaPlayButton(LayoutObject*, const PaintInfo&, const Int
Rect&) override; |
128 virtual bool paintMediaOverlayPlayButton(LayoutObject*, const PaintInfo&, co
nst IntRect&) override; | 128 virtual bool paintMediaOverlayPlayButton(LayoutObject*, const PaintInfo&, co
nst IntRect&) override; |
129 virtual bool paintMediaMuteButton(LayoutObject*, const PaintInfo&, const Int
Rect&) override; | 129 virtual bool paintMediaMuteButton(LayoutObject*, const PaintInfo&, const Int
Rect&) override; |
130 virtual String formatMediaControlsTime(float time) const override; | 130 virtual String formatMediaControlsTime(float time) const override; |
131 virtual String formatMediaControlsCurrentTime(float currentTime, float durat
ion) const override; | 131 virtual String formatMediaControlsCurrentTime(float currentTime, float durat
ion) const override; |
132 virtual bool paintMediaFullscreenButton(LayoutObject*, const PaintInfo&, con
st IntRect&) override; | 132 virtual bool paintMediaFullscreenButton(LayoutObject*, const PaintInfo&, con
st IntRect&) override; |
133 | 133 |
134 // MenuList refers to an unstyled menulist (meaning a menulist without | 134 // MenuList refers to an unstyled menulist (meaning a menulist without |
135 // background-color or border set) and MenuListButton refers to a styled | 135 // background-color or border set) and MenuListButton refers to a styled |
136 // menulist (a menulist with background-color or border set). They have | 136 // menulist (a menulist with background-color or border set). They have |
137 // this distinction to support showing aqua style themes whenever they | 137 // this distinction to support showing aqua style themes whenever they |
138 // possibly can, which is something we don't want to replicate. | 138 // possibly can, which is something we don't want to replicate. |
139 // | 139 // |
140 // In short, we either go down the MenuList code path or the MenuListButton | 140 // In short, we either go down the MenuList code path or the MenuListButton |
141 // codepath. We never go down both. And in both cases, they render the | 141 // codepath. We never go down both. And in both cases, they render the |
142 // entire menulist. | 142 // entire menulist. |
143 virtual void adjustMenuListStyle(LayoutStyle&, Element*) const override; | 143 virtual void adjustMenuListStyle(ComputedStyle&, Element*) const override; |
144 virtual void adjustMenuListButtonStyle(LayoutStyle&, Element*) const overrid
e; | 144 virtual void adjustMenuListButtonStyle(ComputedStyle&, Element*) const overr
ide; |
145 | 145 |
146 virtual double animationRepeatIntervalForProgressBar() const override; | 146 virtual double animationRepeatIntervalForProgressBar() const override; |
147 virtual double animationDurationForProgressBar() const override; | 147 virtual double animationDurationForProgressBar() const override; |
148 | 148 |
149 // These methods define the padding for the MenuList's inner block. | 149 // These methods define the padding for the MenuList's inner block. |
150 virtual int popupInternalPaddingLeft(const LayoutStyle&) const override; | 150 virtual int popupInternalPaddingLeft(const ComputedStyle&) const override; |
151 virtual int popupInternalPaddingRight(const LayoutStyle&) const override; | 151 virtual int popupInternalPaddingRight(const ComputedStyle&) const override; |
152 virtual int popupInternalPaddingTop(const LayoutStyle&) const override; | 152 virtual int popupInternalPaddingTop(const ComputedStyle&) const override; |
153 virtual int popupInternalPaddingBottom(const LayoutStyle&) const override; | 153 virtual int popupInternalPaddingBottom(const ComputedStyle&) const override; |
154 | 154 |
155 // Provide a way to pass the default font size from the Settings object | 155 // Provide a way to pass the default font size from the Settings object |
156 // to the render theme. FIXME: http://b/1129186 A cleaner way would be | 156 // to the render theme. FIXME: http://b/1129186 A cleaner way would be |
157 // to remove the default font size from this object and have callers | 157 // to remove the default font size from this object and have callers |
158 // that need the value to get it directly from the appropriate Settings | 158 // that need the value to get it directly from the appropriate Settings |
159 // object. | 159 // object. |
160 static void setDefaultFontSize(int); | 160 static void setDefaultFontSize(int); |
161 | 161 |
162 static void setSelectionColors(unsigned activeBackgroundColor, unsigned acti
veForegroundColor, unsigned inactiveBackgroundColor, unsigned inactiveForeground
Color); | 162 static void setSelectionColors(unsigned activeBackgroundColor, unsigned acti
veForegroundColor, unsigned inactiveBackgroundColor, unsigned inactiveForeground
Color); |
163 | 163 |
164 protected: | 164 protected: |
165 LayoutThemeDefault(); | 165 LayoutThemeDefault(); |
166 virtual ~LayoutThemeDefault(); | 166 virtual ~LayoutThemeDefault(); |
167 virtual bool shouldUseFallbackTheme(const LayoutStyle&) const override; | 167 virtual bool shouldUseFallbackTheme(const ComputedStyle&) const override; |
168 virtual int menuListArrowPadding() const; | 168 virtual int menuListArrowPadding() const; |
169 | 169 |
170 IntRect determinateProgressValueRectFor(LayoutProgress*, const IntRect&) con
st; | 170 IntRect determinateProgressValueRectFor(LayoutProgress*, const IntRect&) con
st; |
171 IntRect indeterminateProgressValueRectFor(LayoutProgress*, const IntRect&) c
onst; | 171 IntRect indeterminateProgressValueRectFor(LayoutProgress*, const IntRect&) c
onst; |
172 IntRect progressValueRectFor(LayoutProgress*, const IntRect&) const; | 172 IntRect progressValueRectFor(LayoutProgress*, const IntRect&) const; |
173 | 173 |
174 class DirectionFlippingScope { | 174 class DirectionFlippingScope { |
175 public: | 175 public: |
176 DirectionFlippingScope(LayoutObject*, const PaintInfo&, const IntRect&); | 176 DirectionFlippingScope(LayoutObject*, const PaintInfo&, const IntRect&); |
177 ~DirectionFlippingScope(); | 177 ~DirectionFlippingScope(); |
178 | 178 |
179 private: | 179 private: |
180 bool m_needsFlipping; | 180 bool m_needsFlipping; |
181 const PaintInfo& m_paintInfo; | 181 const PaintInfo& m_paintInfo; |
182 }; | 182 }; |
183 | 183 |
184 private: | 184 private: |
185 virtual bool shouldShowPlaceholderWhenFocused() const override; | 185 virtual bool shouldShowPlaceholderWhenFocused() const override; |
186 | 186 |
187 int menuListInternalPadding(const LayoutStyle&, int paddingType) const; | 187 int menuListInternalPadding(const ComputedStyle&, int paddingType) const; |
188 bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*); | 188 bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*); |
189 IntRect convertToPaintingRect(LayoutObject* inputRenderer, const LayoutObjec
t* partRenderer, LayoutRect partRect, const IntRect& localOffset) const; | 189 IntRect convertToPaintingRect(LayoutObject* inputRenderer, const LayoutObjec
t* partRenderer, LayoutRect partRect, const IntRect& localOffset) const; |
190 | 190 |
191 static const RGBA32 defaultTapHighlightColor = 0x2e000000; // 18% black. | 191 static const RGBA32 defaultTapHighlightColor = 0x2e000000; // 18% black. |
192 static double m_caretBlinkInterval; | 192 static double m_caretBlinkInterval; |
193 | 193 |
194 static unsigned m_activeSelectionBackgroundColor; | 194 static unsigned m_activeSelectionBackgroundColor; |
195 static unsigned m_activeSelectionForegroundColor; | 195 static unsigned m_activeSelectionForegroundColor; |
196 static unsigned m_inactiveSelectionBackgroundColor; | 196 static unsigned m_inactiveSelectionBackgroundColor; |
197 static unsigned m_inactiveSelectionForegroundColor; | 197 static unsigned m_inactiveSelectionForegroundColor; |
198 }; | 198 }; |
199 | 199 |
200 } // namespace blink | 200 } // namespace blink |
201 | 201 |
202 #endif // LayoutThemeDefault_h | 202 #endif // LayoutThemeDefault_h |
OLD | NEW |