| 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 14 matching lines...) Expand all Loading... |
| 25 #define RenderThemeChromiumMac_h | 25 #define RenderThemeChromiumMac_h |
| 26 | 26 |
| 27 #import "core/rendering/RenderTheme.h" | 27 #import "core/rendering/RenderTheme.h" |
| 28 #import "wtf/HashMap.h" | 28 #import "wtf/HashMap.h" |
| 29 #import "wtf/RetainPtr.h" | 29 #import "wtf/RetainPtr.h" |
| 30 | 30 |
| 31 OBJC_CLASS WebCoreRenderThemeNotificationObserver; | 31 OBJC_CLASS WebCoreRenderThemeNotificationObserver; |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class RenderThemeChromiumMac FINAL : public RenderTheme { | 35 class RenderThemeChromiumMac final : public RenderTheme { |
| 36 public: | 36 public: |
| 37 static PassRefPtr<RenderTheme> create(); | 37 static PassRefPtr<RenderTheme> create(); |
| 38 | 38 |
| 39 virtual void adjustPaintInvalidationRect(const RenderObject*, IntRect&) OVER
RIDE; | 39 virtual void adjustPaintInvalidationRect(const RenderObject*, IntRect&) over
ride; |
| 40 | 40 |
| 41 virtual bool isControlStyled(const RenderStyle*, const CachedUAStyle*) const
OVERRIDE; | 41 virtual bool isControlStyled(const RenderStyle*, const CachedUAStyle*) const
override; |
| 42 | 42 |
| 43 virtual Color platformActiveSelectionBackgroundColor() const OVERRIDE; | 43 virtual Color platformActiveSelectionBackgroundColor() const override; |
| 44 virtual Color platformInactiveSelectionBackgroundColor() const OVERRIDE; | 44 virtual Color platformInactiveSelectionBackgroundColor() const override; |
| 45 virtual Color platformActiveSelectionForegroundColor() const OVERRIDE; | 45 virtual Color platformActiveSelectionForegroundColor() const override; |
| 46 virtual Color platformActiveListBoxSelectionBackgroundColor() const OVERRIDE
; | 46 virtual Color platformActiveListBoxSelectionBackgroundColor() const override
; |
| 47 virtual Color platformActiveListBoxSelectionForegroundColor() const OVERRIDE
; | 47 virtual Color platformActiveListBoxSelectionForegroundColor() const override
; |
| 48 virtual Color platformInactiveListBoxSelectionBackgroundColor() const OVERRI
DE; | 48 virtual Color platformInactiveListBoxSelectionBackgroundColor() const overri
de; |
| 49 virtual Color platformInactiveListBoxSelectionForegroundColor() const OVERRI
DE; | 49 virtual Color platformInactiveListBoxSelectionForegroundColor() const overri
de; |
| 50 virtual Color platformFocusRingColor() const OVERRIDE; | 50 virtual Color platformFocusRingColor() const override; |
| 51 | 51 |
| 52 virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart part) O
VERRIDE { return part == ListboxPart ? SmallScrollbar : RegularScrollbar; } | 52 virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart part) o
verride { return part == ListboxPart ? SmallScrollbar : RegularScrollbar; } |
| 53 | 53 |
| 54 virtual void platformColorsDidChange() OVERRIDE; | 54 virtual void platformColorsDidChange() override; |
| 55 | 55 |
| 56 // System fonts. | 56 // System fonts. |
| 57 virtual void systemFont(CSSValueID, FontDescription&) const OVERRIDE; | 57 virtual void systemFont(CSSValueID, FontDescription&) const override; |
| 58 | 58 |
| 59 virtual int minimumMenuListSize(RenderStyle*) const OVERRIDE; | 59 virtual int minimumMenuListSize(RenderStyle*) const override; |
| 60 | 60 |
| 61 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const OVERRIDE; | 61 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const override; |
| 62 | 62 |
| 63 virtual IntSize sliderTickSize() const OVERRIDE; | 63 virtual IntSize sliderTickSize() const override; |
| 64 virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE; | 64 virtual int sliderTickOffsetFromTrackCenter() const override; |
| 65 | 65 |
| 66 virtual int popupInternalPaddingLeft(RenderStyle*) const OVERRIDE; | 66 virtual int popupInternalPaddingLeft(RenderStyle*) const override; |
| 67 virtual int popupInternalPaddingRight(RenderStyle*) const OVERRIDE; | 67 virtual int popupInternalPaddingRight(RenderStyle*) const override; |
| 68 virtual int popupInternalPaddingTop(RenderStyle*) const OVERRIDE; | 68 virtual int popupInternalPaddingTop(RenderStyle*) const override; |
| 69 virtual int popupInternalPaddingBottom(RenderStyle*) const OVERRIDE; | 69 virtual int popupInternalPaddingBottom(RenderStyle*) const override; |
| 70 | 70 |
| 71 virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const I
ntRect&) OVERRIDE; | 71 virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const I
ntRect&) override; |
| 72 | 72 |
| 73 virtual bool popsMenuByArrowKeys() const OVERRIDE { return true; } | 73 virtual bool popsMenuByArrowKeys() const override { return true; } |
| 74 virtual bool popsMenuBySpaceKey() const OVERRIDE FINAL { return true; } | 74 virtual bool popsMenuBySpaceKey() const override final { return true; } |
| 75 | 75 |
| 76 virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const
OVERRIDE; | 76 virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const
override; |
| 77 virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&) OVE
RRIDE; | 77 virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&) ove
rride; |
| 78 virtual bool supportsMeter(ControlPart) const OVERRIDE; | 78 virtual bool supportsMeter(ControlPart) const override; |
| 79 | 79 |
| 80 // Returns the repeat interval of the animation for the progress bar. | 80 // Returns the repeat interval of the animation for the progress bar. |
| 81 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const
OVERRIDE; | 81 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const
override; |
| 82 // Returns the duration of the animation for the progress bar. | 82 // Returns the duration of the animation for the progress bar. |
| 83 virtual double animationDurationForProgressBar(RenderProgress*) const OVERRI
DE; | 83 virtual double animationDurationForProgressBar(RenderProgress*) const overri
de; |
| 84 | 84 |
| 85 virtual Color systemColor(CSSValueID) const OVERRIDE; | 85 virtual Color systemColor(CSSValueID) const override; |
| 86 | 86 |
| 87 virtual bool supportsSelectionForegroundColors() const OVERRIDE { return fal
se; } | 87 virtual bool supportsSelectionForegroundColors() const override { return fal
se; } |
| 88 | 88 |
| 89 virtual bool isModalColorChooser() const { return false; } | 89 virtual bool isModalColorChooser() const { return false; } |
| 90 | 90 |
| 91 protected: | 91 protected: |
| 92 RenderThemeChromiumMac(); | 92 RenderThemeChromiumMac(); |
| 93 virtual ~RenderThemeChromiumMac(); | 93 virtual ~RenderThemeChromiumMac(); |
| 94 | 94 |
| 95 virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&)
OVERRIDE; | 95 virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&)
override; |
| 96 | 96 |
| 97 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&)
OVERRIDE; | 97 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&)
override; |
| 98 | 98 |
| 99 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&)
OVERRIDE; | 99 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&)
override; |
| 100 virtual void adjustMenuListStyle(RenderStyle*, Element*) const OVERRIDE; | 100 virtual void adjustMenuListStyle(RenderStyle*, Element*) const override; |
| 101 | 101 |
| 102 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntR
ect&) OVERRIDE; | 102 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntR
ect&) override; |
| 103 virtual void adjustMenuListButtonStyle(RenderStyle*, Element*) const OVERRID
E; | 103 virtual void adjustMenuListButtonStyle(RenderStyle*, Element*) const overrid
e; |
| 104 | 104 |
| 105 virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect
&) OVERRIDE; | 105 virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect
&) override; |
| 106 | 106 |
| 107 virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect
&) OVERRIDE; | 107 virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect
&) override; |
| 108 | 108 |
| 109 virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect
&) OVERRIDE; | 109 virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect
&) override; |
| 110 | 110 |
| 111 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect
&) OVERRIDE; | 111 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect
&) override; |
| 112 virtual void adjustSearchFieldStyle(RenderStyle*, Element*) const OVERRIDE; | 112 virtual void adjustSearchFieldStyle(RenderStyle*, Element*) const override; |
| 113 | 113 |
| 114 virtual void adjustSearchFieldCancelButtonStyle(RenderStyle*, Element*) cons
t OVERRIDE; | 114 virtual void adjustSearchFieldCancelButtonStyle(RenderStyle*, Element*) cons
t override; |
| 115 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, c
onst IntRect&) OVERRIDE; | 115 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, c
onst IntRect&) override; |
| 116 | 116 |
| 117 virtual void adjustSearchFieldDecorationStyle(RenderStyle*, Element*) const
OVERRIDE; | 117 virtual void adjustSearchFieldDecorationStyle(RenderStyle*, Element*) const
override; |
| 118 virtual bool paintSearchFieldDecoration(RenderObject*, const PaintInfo&, con
st IntRect&) OVERRIDE; | 118 virtual bool paintSearchFieldDecoration(RenderObject*, const PaintInfo&, con
st IntRect&) override; |
| 119 | 119 |
| 120 virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle*, Element*)
const OVERRIDE; | 120 virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle*, Element*)
const override; |
| 121 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInf
o&, const IntRect&) OVERRIDE; | 121 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInf
o&, const IntRect&) override; |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 virtual String fileListNameForWidth(Locale&, const FileList*, const Font&, i
nt width) const OVERRIDE; | 124 virtual String fileListNameForWidth(Locale&, const FileList*, const Font&, i
nt width) const override; |
| 125 | 125 |
| 126 FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const Ren
derObject* partRenderer, const FloatRect& inputRect, const IntRect&) const; | 126 FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const Ren
derObject* partRenderer, const FloatRect& inputRect, const IntRect&) const; |
| 127 | 127 |
| 128 // Get the control size based off the font. Used by some of the controls (li
ke buttons). | 128 // Get the control size based off the font. Used by some of the controls (li
ke buttons). |
| 129 NSControlSize controlSizeForFont(RenderStyle*) const; | 129 NSControlSize controlSizeForFont(RenderStyle*) const; |
| 130 NSControlSize controlSizeForSystemFont(RenderStyle*) const; | 130 NSControlSize controlSizeForSystemFont(RenderStyle*) const; |
| 131 void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, f
loat zoomLevel = 1.0f); | 131 void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, f
loat zoomLevel = 1.0f); |
| 132 void setSizeFromFont(RenderStyle*, const IntSize* sizes) const; | 132 void setSizeFromFont(RenderStyle*, const IntSize* sizes) const; |
| 133 IntSize sizeForFont(RenderStyle*, const IntSize* sizes) const; | 133 IntSize sizeForFont(RenderStyle*, const IntSize* sizes) const; |
| 134 IntSize sizeForSystemFont(RenderStyle*, const IntSize* sizes) const; | 134 IntSize sizeForSystemFont(RenderStyle*, const IntSize* sizes) const; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 159 | 159 |
| 160 NSLevelIndicatorStyle levelIndicatorStyleFor(ControlPart) const; | 160 NSLevelIndicatorStyle levelIndicatorStyleFor(ControlPart) const; |
| 161 NSLevelIndicatorCell* levelIndicatorFor(const RenderMeter*) const; | 161 NSLevelIndicatorCell* levelIndicatorFor(const RenderMeter*) const; |
| 162 | 162 |
| 163 int minimumProgressBarHeight(RenderStyle*) const; | 163 int minimumProgressBarHeight(RenderStyle*) const; |
| 164 const IntSize* progressBarSizes() const; | 164 const IntSize* progressBarSizes() const; |
| 165 const int* progressBarMargins(NSControlSize) const; | 165 const int* progressBarMargins(NSControlSize) const; |
| 166 | 166 |
| 167 protected: | 167 protected: |
| 168 virtual void adjustMediaSliderThumbSize(RenderStyle*) const; | 168 virtual void adjustMediaSliderThumbSize(RenderStyle*) const; |
| 169 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const Int
Rect&) OVERRIDE; | 169 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const Int
Rect&) override; |
| 170 virtual bool paintMediaOverlayPlayButton(RenderObject*, const PaintInfo&, co
nst IntRect&) OVERRIDE; | 170 virtual bool paintMediaOverlayPlayButton(RenderObject*, const PaintInfo&, co
nst IntRect&) override; |
| 171 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const Int
Rect&) OVERRIDE; | 171 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const Int
Rect&) override; |
| 172 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const In
tRect&) OVERRIDE; | 172 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const In
tRect&) override; |
| 173 virtual String extraFullScreenStyleSheet() OVERRIDE; | 173 virtual String extraFullScreenStyleSheet() override; |
| 174 | 174 |
| 175 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const In
tRect&) OVERRIDE; | 175 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const In
tRect&) override; |
| 176 virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&
, const IntRect&) OVERRIDE; | 176 virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&
, const IntRect&) override; |
| 177 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, co
nst IntRect&) OVERRIDE; | 177 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, co
nst IntRect&) override; |
| 178 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co
nst IntRect&) OVERRIDE; | 178 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co
nst IntRect&) override; |
| 179 virtual String formatMediaControlsTime(float time) const OVERRIDE; | 179 virtual String formatMediaControlsTime(float time) const override; |
| 180 virtual String formatMediaControlsCurrentTime(float currentTime, float durat
ion) const OVERRIDE; | 180 virtual String formatMediaControlsCurrentTime(float currentTime, float durat
ion) const override; |
| 181 virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, con
st IntRect&) OVERRIDE; | 181 virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, con
st IntRect&) override; |
| 182 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint
Info&, const IntRect&) OVERRIDE; | 182 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint
Info&, const IntRect&) override; |
| 183 | 183 |
| 184 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. | 184 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. |
| 185 bool usesTestModeFocusRingColor() const; | 185 bool usesTestModeFocusRingColor() const; |
| 186 // A view associated to the contained document. Subclasses may not have such
a view and return a fake. | 186 // A view associated to the contained document. Subclasses may not have such
a view and return a fake. |
| 187 NSView* documentViewFor(RenderObject*) const; | 187 NSView* documentViewFor(RenderObject*) const; |
| 188 | 188 |
| 189 virtual bool shouldUseFallbackTheme(RenderStyle*) const OVERRIDE; | 189 virtual bool shouldUseFallbackTheme(RenderStyle*) const override; |
| 190 | 190 |
| 191 private: | 191 private: |
| 192 virtual void updateActiveState(NSCell*, const RenderObject*); | 192 virtual void updateActiveState(NSCell*, const RenderObject*); |
| 193 virtual String extraDefaultStyleSheet() OVERRIDE; | 193 virtual String extraDefaultStyleSheet() override; |
| 194 virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE; | 194 virtual bool shouldShowPlaceholderWhenFocused() const override; |
| 195 | 195 |
| 196 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; | 196 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; |
| 197 mutable RetainPtr<NSSearchFieldCell> m_search; | 197 mutable RetainPtr<NSSearchFieldCell> m_search; |
| 198 mutable RetainPtr<NSMenu> m_searchMenuTemplate; | 198 mutable RetainPtr<NSMenu> m_searchMenuTemplate; |
| 199 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; | 199 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; |
| 200 mutable RetainPtr<NSTextFieldCell> m_textField; | 200 mutable RetainPtr<NSTextFieldCell> m_textField; |
| 201 | 201 |
| 202 mutable HashMap<int, RGBA32> m_systemColorCache; | 202 mutable HashMap<int, RGBA32> m_systemColorCache; |
| 203 | 203 |
| 204 RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver; | 204 RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver; |
| 205 }; | 205 }; |
| 206 | 206 |
| 207 } // namespace blink | 207 } // namespace blink |
| 208 | 208 |
| 209 #endif // RenderThemeChromiumMac_h | 209 #endif // RenderThemeChromiumMac_h |
| OLD | NEW |