| 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 WebCore { | 33 namespace WebCore { |
| 34 | 34 |
| 35 class RenderThemeChromiumMac : 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 // A method asking if the control changes its tint when the window has focus
or not. | 39 // A method asking if the control changes its tint when the window has focus
or not. |
| 40 virtual bool controlSupportsTints(const RenderObject*) const OVERRIDE; | 40 virtual bool controlSupportsTints(const RenderObject*) const OVERRIDE; |
| 41 | 41 |
| 42 // A general method asking if any control tinting is supported at all. | 42 // A general method asking if any control tinting is supported at all. |
| 43 virtual bool supportsControlTints() const OVERRIDE { return true; } | 43 virtual bool supportsControlTints() const OVERRIDE { return true; } |
| 44 | 44 |
| 45 virtual void adjustRepaintRect(const RenderObject*, IntRect&) OVERRIDE; | 45 virtual void adjustRepaintRect(const RenderObject*, IntRect&) OVERRIDE; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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*, const PaintInfo&, const IntRect&)
OVERRIDE; |
| 98 | 98 |
| 99 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&); | 99 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&)
OVERRIDE; |
| 100 | 100 |
| 101 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&); | 101 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&)
OVERRIDE; |
| 102 virtual void adjustMenuListStyle(RenderStyle*, Element*) const; | 102 virtual void adjustMenuListStyle(RenderStyle*, Element*) const OVERRIDE; |
| 103 | 103 |
| 104 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntR
ect&); | 104 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntR
ect&) OVERRIDE; |
| 105 virtual void adjustMenuListButtonStyle(RenderStyle*, Element*) const; | 105 virtual void adjustMenuListButtonStyle(RenderStyle*, Element*) const OVERRID
E; |
| 106 | 106 |
| 107 virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect
&); | 107 virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect
&) OVERRIDE; |
| 108 | 108 |
| 109 virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect
&); | 109 virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect
&) OVERRIDE; |
| 110 | 110 |
| 111 virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect
&); | 111 virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect
&) OVERRIDE; |
| 112 | 112 |
| 113 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect
&); | 113 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect
&) OVERRIDE; |
| 114 virtual void adjustSearchFieldStyle(RenderStyle*, Element*) const; | 114 virtual void adjustSearchFieldStyle(RenderStyle*, Element*) const OVERRIDE; |
| 115 | 115 |
| 116 virtual void adjustSearchFieldCancelButtonStyle(RenderStyle*, Element*) cons
t; | 116 virtual void adjustSearchFieldCancelButtonStyle(RenderStyle*, Element*) cons
t OVERRIDE; |
| 117 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, c
onst IntRect&); | 117 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, c
onst IntRect&) OVERRIDE; |
| 118 | 118 |
| 119 virtual void adjustSearchFieldDecorationStyle(RenderStyle*, Element*) const; | 119 virtual void adjustSearchFieldDecorationStyle(RenderStyle*, Element*) const
OVERRIDE; |
| 120 virtual bool paintSearchFieldDecoration(RenderObject*, const PaintInfo&, con
st IntRect&); | 120 virtual bool paintSearchFieldDecoration(RenderObject*, const PaintInfo&, con
st IntRect&) OVERRIDE; |
| 121 | 121 |
| 122 virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle*, Element*)
const; | 122 virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle*, Element*)
const OVERRIDE; |
| 123 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInf
o&, const IntRect&); | 123 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInf
o&, const IntRect&) OVERRIDE; |
| 124 | 124 |
| 125 virtual bool supportsClosedCaptioning() const { return true; } | 125 virtual bool supportsClosedCaptioning() const OVERRIDE { return true; } |
| 126 | 126 |
| 127 private: | 127 private: |
| 128 virtual String fileListNameForWidth(Locale&, const FileList*, const Font&, i
nt width) const OVERRIDE; | 128 virtual String fileListNameForWidth(Locale&, const FileList*, const Font&, i
nt width) const OVERRIDE; |
| 129 | 129 |
| 130 IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, floa
t zoomLevel = 1.0f) const; | 130 IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, floa
t zoomLevel = 1.0f) const; |
| 131 | 131 |
| 132 FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const Ren
derObject* partRenderer, const FloatRect& inputRect, const IntRect&) const; | 132 FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const Ren
derObject* partRenderer, const FloatRect& inputRect, const IntRect&) const; |
| 133 | 133 |
| 134 // Get the control size based off the font. Used by some of the controls (li
ke buttons). | 134 // Get the control size based off the font. Used by some of the controls (li
ke buttons). |
| 135 NSControlSize controlSizeForFont(RenderStyle*) const; | 135 NSControlSize controlSizeForFont(RenderStyle*) const; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 NSLevelIndicatorStyle levelIndicatorStyleFor(ControlPart) const; | 168 NSLevelIndicatorStyle levelIndicatorStyleFor(ControlPart) const; |
| 169 NSLevelIndicatorCell* levelIndicatorFor(const RenderMeter*) const; | 169 NSLevelIndicatorCell* levelIndicatorFor(const RenderMeter*) const; |
| 170 | 170 |
| 171 int minimumProgressBarHeight(RenderStyle*) const; | 171 int minimumProgressBarHeight(RenderStyle*) const; |
| 172 const IntSize* progressBarSizes() const; | 172 const IntSize* progressBarSizes() const; |
| 173 const int* progressBarMargins(NSControlSize) const; | 173 const int* progressBarMargins(NSControlSize) const; |
| 174 | 174 |
| 175 protected: | 175 protected: |
| 176 virtual void adjustMediaSliderThumbSize(RenderStyle*) const; | 176 virtual void adjustMediaSliderThumbSize(RenderStyle*) const; |
| 177 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const Int
Rect&); | 177 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const Int
Rect&) OVERRIDE; |
| 178 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const Int
Rect&); | 178 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const Int
Rect&) OVERRIDE; |
| 179 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const In
tRect&); | 179 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const In
tRect&) OVERRIDE; |
| 180 virtual String extraFullScreenStyleSheet(); | 180 virtual String extraFullScreenStyleSheet() OVERRIDE; |
| 181 | 181 |
| 182 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const In
tRect&); | 182 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const In
tRect&) OVERRIDE; |
| 183 virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&
, const IntRect&); | 183 virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&
, const IntRect&) OVERRIDE; |
| 184 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, co
nst IntRect&); | 184 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, co
nst IntRect&) OVERRIDE; |
| 185 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co
nst IntRect&); | 185 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co
nst IntRect&) OVERRIDE; |
| 186 virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true
; } | 186 virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const OVERRIDE { re
turn true; } |
| 187 virtual bool usesVerticalVolumeSlider() const { return false; } | 187 virtual bool usesVerticalVolumeSlider() const OVERRIDE { return false; } |
| 188 virtual String formatMediaControlsTime(float time) const; | 188 virtual String formatMediaControlsTime(float time) const OVERRIDE; |
| 189 virtual String formatMediaControlsCurrentTime(float currentTime, float durat
ion) const; | 189 virtual String formatMediaControlsCurrentTime(float currentTime, float durat
ion) const OVERRIDE; |
| 190 virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, con
st IntRect&); | 190 virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, con
st IntRect&) OVERRIDE; |
| 191 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint
Info&, const IntRect&); | 191 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint
Info&, const IntRect&) OVERRIDE; |
| 192 | 192 |
| 193 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. | 193 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. |
| 194 bool usesTestModeFocusRingColor() const; | 194 bool usesTestModeFocusRingColor() const; |
| 195 // A view associated to the contained document. Subclasses may not have such
a view and return a fake. | 195 // A view associated to the contained document. Subclasses may not have such
a view and return a fake. |
| 196 NSView* documentViewFor(RenderObject*) const; | 196 NSView* documentViewFor(RenderObject*) const; |
| 197 | 197 |
| 198 virtual bool shouldUseFallbackTheme(RenderStyle*) const OVERRIDE; | 198 virtual bool shouldUseFallbackTheme(RenderStyle*) const OVERRIDE; |
| 199 | 199 |
| 200 private: | 200 private: |
| 201 virtual void updateActiveState(NSCell*, const RenderObject*); | 201 virtual void updateActiveState(NSCell*, const RenderObject*); |
| 202 virtual String extraDefaultStyleSheet(); | 202 virtual String extraDefaultStyleSheet() OVERRIDE; |
| 203 virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE; | 203 virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE; |
| 204 | 204 |
| 205 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; | 205 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; |
| 206 mutable RetainPtr<NSSearchFieldCell> m_search; | 206 mutable RetainPtr<NSSearchFieldCell> m_search; |
| 207 mutable RetainPtr<NSMenu> m_searchMenuTemplate; | 207 mutable RetainPtr<NSMenu> m_searchMenuTemplate; |
| 208 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; | 208 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; |
| 209 mutable RetainPtr<NSTextFieldCell> m_textField; | 209 mutable RetainPtr<NSTextFieldCell> m_textField; |
| 210 | 210 |
| 211 mutable HashMap<int, RGBA32> m_systemColorCache; | 211 mutable HashMap<int, RGBA32> m_systemColorCache; |
| 212 | 212 |
| 213 RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver; | 213 RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver; |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace WebCore | 216 } // namespace WebCore |
| 217 | 217 |
| 218 #endif // RenderThemeChromiumMac_h | 218 #endif // RenderThemeChromiumMac_h |
| OLD | NEW |