| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the theme implementation for form controls in WebCore. | 2 * This file is part of the theme implementation for form controls in WebCore. |
| 3 * | 3 * |
| 4 * Copyright (C) 2005 Apple Computer, Inc. | 4 * Copyright (C) 2005 Apple Computer, Inc. |
| 5 * Copyright (C) 2008, 2009 Google, Inc. | 5 * Copyright (C) 2008, 2009 Google, Inc. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const OVERRIDE; | 66 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const OVERRIDE; |
| 67 | 67 |
| 68 virtual IntSize sliderTickSize() const OVERRIDE; | 68 virtual IntSize sliderTickSize() const OVERRIDE; |
| 69 virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE; | 69 virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE; |
| 70 | 70 |
| 71 virtual int popupInternalPaddingLeft(RenderStyle*) const OVERRIDE; | 71 virtual int popupInternalPaddingLeft(RenderStyle*) const OVERRIDE; |
| 72 virtual int popupInternalPaddingRight(RenderStyle*) const OVERRIDE; | 72 virtual int popupInternalPaddingRight(RenderStyle*) const OVERRIDE; |
| 73 virtual int popupInternalPaddingTop(RenderStyle*) const OVERRIDE; | 73 virtual int popupInternalPaddingTop(RenderStyle*) const OVERRIDE; |
| 74 virtual int popupInternalPaddingBottom(RenderStyle*) const OVERRIDE; | 74 virtual int popupInternalPaddingBottom(RenderStyle*) const OVERRIDE; |
| 75 | 75 |
| 76 virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const I
ntRect&) OVERRIDE; | 76 virtual bool paintCapsLockIndicator(RenderObject*, PaintInfo&, const IntRect
&) OVERRIDE; |
| 77 | 77 |
| 78 virtual bool popsMenuByArrowKeys() const OVERRIDE { return true; } | 78 virtual bool popsMenuByArrowKeys() const OVERRIDE { return true; } |
| 79 | 79 |
| 80 virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const
OVERRIDE; | 80 virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const
OVERRIDE; |
| 81 virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&) OVE
RRIDE; | 81 virtual bool paintMeter(RenderObject*, PaintInfo&, const IntRect&) OVERRIDE; |
| 82 virtual bool supportsMeter(ControlPart) const OVERRIDE; | 82 virtual bool supportsMeter(ControlPart) const OVERRIDE; |
| 83 | 83 |
| 84 // Returns the repeat interval of the animation for the progress bar. | 84 // Returns the repeat interval of the animation for the progress bar. |
| 85 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const
OVERRIDE; | 85 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const
OVERRIDE; |
| 86 // Returns the duration of the animation for the progress bar. | 86 // Returns the duration of the animation for the progress bar. |
| 87 virtual double animationDurationForProgressBar(RenderProgress*) const OVERRI
DE; | 87 virtual double animationDurationForProgressBar(RenderProgress*) const OVERRI
DE; |
| 88 | 88 |
| 89 virtual Color systemColor(CSSValueID) const OVERRIDE; | 89 virtual Color systemColor(CSSValueID) const OVERRIDE; |
| 90 | 90 |
| 91 protected: | 91 protected: |
| 92 RenderThemeChromiumMac(); | 92 RenderThemeChromiumMac(); |
| 93 virtual ~RenderThemeChromiumMac(); | 93 virtual ~RenderThemeChromiumMac(); |
| 94 | 94 |
| 95 virtual bool supportsSelectionForegroundColors() const OVERRIDE { return fal
se; } | 95 virtual bool supportsSelectionForegroundColors() const OVERRIDE { return fal
se; } |
| 96 | 96 |
| 97 virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&)
; | 97 virtual bool paintTextField(RenderObject*, PaintInfo&, const IntRect&); |
| 98 virtual void adjustTextFieldStyle(RenderStyle*, Element*) const; | 98 virtual void adjustTextFieldStyle(RenderStyle*, Element*) const; |
| 99 | 99 |
| 100 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&); | 100 virtual bool paintTextArea(RenderObject*, PaintInfo&, const IntRect&); |
| 101 virtual void adjustTextAreaStyle(RenderStyle*, Element*) const; | 101 virtual void adjustTextAreaStyle(RenderStyle*, Element*) const; |
| 102 | 102 |
| 103 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&); | 103 virtual bool paintMenuList(RenderObject*, PaintInfo&, const IntRect&); |
| 104 virtual void adjustMenuListStyle(RenderStyle*, Element*) const; | 104 virtual void adjustMenuListStyle(RenderStyle*, Element*) const; |
| 105 | 105 |
| 106 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntR
ect&); | 106 virtual bool paintMenuListButton(RenderObject*, PaintInfo&, const IntRect&); |
| 107 virtual void adjustMenuListButtonStyle(RenderStyle*, Element*) const; | 107 virtual void adjustMenuListButtonStyle(RenderStyle*, Element*) const; |
| 108 | 108 |
| 109 virtual void adjustProgressBarStyle(RenderStyle*, Element*) const; | 109 virtual void adjustProgressBarStyle(RenderStyle*, Element*) const; |
| 110 virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect
&); | 110 virtual bool paintProgressBar(RenderObject*, PaintInfo&, const IntRect&); |
| 111 | 111 |
| 112 virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect
&); | 112 virtual bool paintSliderTrack(RenderObject*, PaintInfo&, const IntRect&); |
| 113 | 113 |
| 114 virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect
&); | 114 virtual bool paintSliderThumb(RenderObject*, PaintInfo&, const IntRect&); |
| 115 | 115 |
| 116 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect
&); | 116 virtual bool paintSearchField(RenderObject*, PaintInfo&, const IntRect&); |
| 117 virtual void adjustSearchFieldStyle(RenderStyle*, Element*) const; | 117 virtual void adjustSearchFieldStyle(RenderStyle*, Element*) const; |
| 118 | 118 |
| 119 virtual void adjustSearchFieldCancelButtonStyle(RenderStyle*, Element*) cons
t; | 119 virtual void adjustSearchFieldCancelButtonStyle(RenderStyle*, Element*) cons
t; |
| 120 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, c
onst IntRect&); | 120 virtual bool paintSearchFieldCancelButton(RenderObject*, PaintInfo&, const I
ntRect&); |
| 121 | 121 |
| 122 virtual void adjustSearchFieldDecorationStyle(RenderStyle*, Element*) const; | 122 virtual void adjustSearchFieldDecorationStyle(RenderStyle*, Element*) const; |
| 123 virtual bool paintSearchFieldDecoration(RenderObject*, const PaintInfo&, con
st IntRect&); | 123 virtual bool paintSearchFieldDecoration(RenderObject*, PaintInfo&, const Int
Rect&); |
| 124 | 124 |
| 125 virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle*, Element*)
const; | 125 virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle*, Element*)
const; |
| 126 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInf
o&, const IntRect&); | 126 virtual bool paintSearchFieldResultsDecoration(RenderObject*, PaintInfo&, co
nst IntRect&); |
| 127 | 127 |
| 128 virtual bool supportsClosedCaptioning() const { return true; } | 128 virtual bool supportsClosedCaptioning() const { return true; } |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 virtual String fileListNameForWidth(const FileList*, const Font&, int width,
bool multipleFilesAllowed) const OVERRIDE; | 131 virtual String fileListNameForWidth(const FileList*, const Font&, int width,
bool multipleFilesAllowed) const OVERRIDE; |
| 132 | 132 |
| 133 IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, floa
t zoomLevel = 1.0f) const; | 133 IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, floa
t zoomLevel = 1.0f) const; |
| 134 | 134 |
| 135 FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const Ren
derObject* partRenderer, const FloatRect& inputRect, const IntRect&) const; | 135 FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const Ren
derObject* partRenderer, const FloatRect& inputRect, const IntRect&) const; |
| 136 | 136 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 147 void updateEnabledState(NSCell*, const RenderObject*); | 147 void updateEnabledState(NSCell*, const RenderObject*); |
| 148 void updateFocusedState(NSCell*, const RenderObject*); | 148 void updateFocusedState(NSCell*, const RenderObject*); |
| 149 void updatePressedState(NSCell*, const RenderObject*); | 149 void updatePressedState(NSCell*, const RenderObject*); |
| 150 | 150 |
| 151 // Helpers for adjusting appearance and for painting | 151 // Helpers for adjusting appearance and for painting |
| 152 | 152 |
| 153 void setPopupButtonCellState(const RenderObject*, const IntRect&); | 153 void setPopupButtonCellState(const RenderObject*, const IntRect&); |
| 154 const IntSize* popupButtonSizes() const; | 154 const IntSize* popupButtonSizes() const; |
| 155 const int* popupButtonMargins() const; | 155 const int* popupButtonMargins() const; |
| 156 const int* popupButtonPadding(NSControlSize) const; | 156 const int* popupButtonPadding(NSControlSize) const; |
| 157 void paintMenuListButtonGradients(RenderObject*, const PaintInfo&, const Int
Rect&); | 157 void paintMenuListButtonGradients(RenderObject*, PaintInfo&, const IntRect&)
; |
| 158 const IntSize* menuListSizes() const; | 158 const IntSize* menuListSizes() const; |
| 159 | 159 |
| 160 const IntSize* searchFieldSizes() const; | 160 const IntSize* searchFieldSizes() const; |
| 161 const IntSize* cancelButtonSizes() const; | 161 const IntSize* cancelButtonSizes() const; |
| 162 const IntSize* resultsButtonSizes() const; | 162 const IntSize* resultsButtonSizes() const; |
| 163 void setSearchCellState(RenderObject*, const IntRect&); | 163 void setSearchCellState(RenderObject*, const IntRect&); |
| 164 void setSearchFieldSize(RenderStyle*) const; | 164 void setSearchFieldSize(RenderStyle*) const; |
| 165 | 165 |
| 166 NSPopUpButtonCell* popupButton() const; | 166 NSPopUpButtonCell* popupButton() const; |
| 167 NSSearchFieldCell* search() const; | 167 NSSearchFieldCell* search() const; |
| 168 NSMenu* searchMenuTemplate() const; | 168 NSMenu* searchMenuTemplate() const; |
| 169 NSTextFieldCell* textField() const; | 169 NSTextFieldCell* textField() const; |
| 170 | 170 |
| 171 NSLevelIndicatorStyle levelIndicatorStyleFor(ControlPart) const; | 171 NSLevelIndicatorStyle levelIndicatorStyleFor(ControlPart) const; |
| 172 NSLevelIndicatorCell* levelIndicatorFor(const RenderMeter*) const; | 172 NSLevelIndicatorCell* levelIndicatorFor(const RenderMeter*) const; |
| 173 | 173 |
| 174 int minimumProgressBarHeight(RenderStyle*) const; | 174 int minimumProgressBarHeight(RenderStyle*) const; |
| 175 const IntSize* progressBarSizes() const; | 175 const IntSize* progressBarSizes() const; |
| 176 const int* progressBarMargins(NSControlSize) const; | 176 const int* progressBarMargins(NSControlSize) const; |
| 177 | 177 |
| 178 protected: | 178 protected: |
| 179 virtual void adjustMediaSliderThumbSize(RenderStyle*) const; | 179 virtual void adjustMediaSliderThumbSize(RenderStyle*) const; |
| 180 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const Int
Rect&); | 180 virtual bool paintMediaPlayButton(RenderObject*, PaintInfo&, const IntRect&)
; |
| 181 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const Int
Rect&); | 181 virtual bool paintMediaMuteButton(RenderObject*, PaintInfo&, const IntRect&)
; |
| 182 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const In
tRect&); | 182 virtual bool paintMediaSliderTrack(RenderObject*, PaintInfo&, const IntRect&
); |
| 183 virtual String extraFullScreenStyleSheet(); | 183 virtual String extraFullScreenStyleSheet(); |
| 184 | 184 |
| 185 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const In
tRect&); | 185 virtual bool paintMediaSliderThumb(RenderObject*, PaintInfo&, const IntRect&
); |
| 186 virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&
, const IntRect&); | 186 virtual bool paintMediaVolumeSliderContainer(RenderObject*, PaintInfo&, cons
t IntRect&); |
| 187 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, co
nst IntRect&); | 187 virtual bool paintMediaVolumeSliderTrack(RenderObject*, PaintInfo&, const In
tRect&); |
| 188 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co
nst IntRect&); | 188 virtual bool paintMediaVolumeSliderThumb(RenderObject*, PaintInfo&, const In
tRect&); |
| 189 virtual bool usesMediaControlStatusDisplay() { return false; } | 189 virtual bool usesMediaControlStatusDisplay() { return false; } |
| 190 virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true
; } | 190 virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true
; } |
| 191 virtual bool usesVerticalVolumeSlider() const { return false; } | 191 virtual bool usesVerticalVolumeSlider() const { return false; } |
| 192 virtual String formatMediaControlsTime(float time) const; | 192 virtual String formatMediaControlsTime(float time) const; |
| 193 virtual String formatMediaControlsCurrentTime(float currentTime, float durat
ion) const; | 193 virtual String formatMediaControlsCurrentTime(float currentTime, float durat
ion) const; |
| 194 virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, con
st IntRect&); | 194 virtual bool paintMediaFullscreenButton(RenderObject*, PaintInfo&, const Int
Rect&); |
| 195 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint
Info&, const IntRect&); | 195 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, PaintInfo&,
const IntRect&); |
| 196 | 196 |
| 197 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. | 197 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. |
| 198 bool usesTestModeFocusRingColor() const; | 198 bool usesTestModeFocusRingColor() const; |
| 199 // A view associated to the contained document. Subclasses may not have such
a view and return a fake. | 199 // A view associated to the contained document. Subclasses may not have such
a view and return a fake. |
| 200 NSView* documentViewFor(RenderObject*) const; | 200 NSView* documentViewFor(RenderObject*) const; |
| 201 | 201 |
| 202 virtual bool shouldUseFallbackTheme(RenderStyle*) const OVERRIDE; | 202 virtual bool shouldUseFallbackTheme(RenderStyle*) const OVERRIDE; |
| 203 | 203 |
| 204 private: | 204 private: |
| 205 virtual void updateActiveState(NSCell*, const RenderObject*); | 205 virtual void updateActiveState(NSCell*, const RenderObject*); |
| 206 virtual String extraDefaultStyleSheet(); | 206 virtual String extraDefaultStyleSheet(); |
| 207 virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE; | 207 virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE; |
| 208 | 208 |
| 209 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; | 209 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; |
| 210 mutable RetainPtr<NSSearchFieldCell> m_search; | 210 mutable RetainPtr<NSSearchFieldCell> m_search; |
| 211 mutable RetainPtr<NSMenu> m_searchMenuTemplate; | 211 mutable RetainPtr<NSMenu> m_searchMenuTemplate; |
| 212 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; | 212 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; |
| 213 mutable RetainPtr<NSTextFieldCell> m_textField; | 213 mutable RetainPtr<NSTextFieldCell> m_textField; |
| 214 | 214 |
| 215 mutable HashMap<int, RGBA32> m_systemColorCache; | 215 mutable HashMap<int, RGBA32> m_systemColorCache; |
| 216 | 216 |
| 217 RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver; | 217 RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver; |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 } // namespace WebCore | 220 } // namespace WebCore |
| 221 | 221 |
| 222 #endif // RenderThemeChromiumMac_h | 222 #endif // RenderThemeChromiumMac_h |
| OLD | NEW |