Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: Source/core/layout/LayoutThemeChromiumMac.h

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 18 matching lines...) Expand all
29 #import "wtf/RetainPtr.h" 29 #import "wtf/RetainPtr.h"
30 30
31 OBJC_CLASS LayoutThemeNotificationObserver; 31 OBJC_CLASS LayoutThemeNotificationObserver;
32 32
33 namespace blink { 33 namespace blink {
34 34
35 class LayoutThemeChromiumMac final : public LayoutTheme { 35 class LayoutThemeChromiumMac final : public LayoutTheme {
36 public: 36 public:
37 static PassRefPtr<LayoutTheme> create(); 37 static PassRefPtr<LayoutTheme> create();
38 38
39 virtual void adjustPaintInvalidationRect(const RenderObject*, IntRect&) over ride; 39 virtual void adjustPaintInvalidationRect(const LayoutObject*, 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;
(...skipping 11 matching lines...) Expand all
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(const RenderStyle&) const override; 66 virtual int popupInternalPaddingLeft(const RenderStyle&) const override;
67 virtual int popupInternalPaddingRight(const RenderStyle&) const override; 67 virtual int popupInternalPaddingRight(const RenderStyle&) const override;
68 virtual int popupInternalPaddingTop(const RenderStyle&) const override; 68 virtual int popupInternalPaddingTop(const RenderStyle&) const override;
69 virtual int popupInternalPaddingBottom(const RenderStyle&) const override; 69 virtual int popupInternalPaddingBottom(const RenderStyle&) const override;
70 70
71 virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const I ntRect&) override; 71 virtual bool paintCapsLockIndicator(LayoutObject*, 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(LayoutObject*, 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 LayoutThemeChromiumMac(); 92 LayoutThemeChromiumMac();
93 virtual ~LayoutThemeChromiumMac(); 93 virtual ~LayoutThemeChromiumMac();
94 94
95 virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&) override; 95 virtual bool paintTextField(LayoutObject*, const PaintInfo&, const IntRect&) override;
96 96
97 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&) override; 97 virtual bool paintTextArea(LayoutObject*, const PaintInfo&, const IntRect&) override;
98 98
99 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) override; 99 virtual bool paintMenuList(LayoutObject*, 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(LayoutObject*, 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(LayoutObject*, const PaintInfo&, const IntRect &) override;
106 106
107 virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect &) override; 107 virtual bool paintSliderTrack(LayoutObject*, const PaintInfo&, const IntRect &) override;
108 108
109 virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect &) override; 109 virtual bool paintSliderThumb(LayoutObject*, const PaintInfo&, const IntRect &) override;
110 110
111 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect &) override; 111 virtual bool paintSearchField(LayoutObject*, 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(LayoutObject*, 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(LayoutObject*, 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(LayoutObject*, 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 LayoutObject* inputRenderer, const Lay outObject* 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(const RenderStyle&) const; 129 NSControlSize controlSizeForFont(const RenderStyle&) const;
130 NSControlSize controlSizeForSystemFont(const RenderStyle&) const; 130 NSControlSize controlSizeForSystemFont(const 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(const RenderStyle&, const IntSize* sizes) const; 133 IntSize sizeForFont(const RenderStyle&, const IntSize* sizes) const;
134 IntSize sizeForSystemFont(const RenderStyle&, const IntSize* sizes) const; 134 IntSize sizeForSystemFont(const RenderStyle&, const IntSize* sizes) const;
135 void setFontFromControlSize(RenderStyle&, NSControlSize) const; 135 void setFontFromControlSize(RenderStyle&, NSControlSize) const;
136 136
137 void updateCheckedState(NSCell*, const RenderObject*); 137 void updateCheckedState(NSCell*, const LayoutObject*);
138 void updateEnabledState(NSCell*, const RenderObject*); 138 void updateEnabledState(NSCell*, const LayoutObject*);
139 void updateFocusedState(NSCell*, const RenderObject*); 139 void updateFocusedState(NSCell*, const LayoutObject*);
140 void updatePressedState(NSCell*, const RenderObject*); 140 void updatePressedState(NSCell*, const LayoutObject*);
141 141
142 // Helpers for adjusting appearance and for painting 142 // Helpers for adjusting appearance and for painting
143 143
144 void setPopupButtonCellState(const RenderObject*, const IntRect&); 144 void setPopupButtonCellState(const LayoutObject*, const IntRect&);
145 const IntSize* popupButtonSizes() const; 145 const IntSize* popupButtonSizes() const;
146 const int* popupButtonMargins() const; 146 const int* popupButtonMargins() const;
147 const int* popupButtonPadding(NSControlSize) const; 147 const int* popupButtonPadding(NSControlSize) const;
148 const IntSize* menuListSizes() const; 148 const IntSize* menuListSizes() const;
149 149
150 const IntSize* searchFieldSizes() const; 150 const IntSize* searchFieldSizes() const;
151 const IntSize* cancelButtonSizes() const; 151 const IntSize* cancelButtonSizes() const;
152 const IntSize* resultsButtonSizes() const; 152 const IntSize* resultsButtonSizes() const;
153 void setSearchCellState(RenderObject*, const IntRect&); 153 void setSearchCellState(LayoutObject*, const IntRect&);
154 void setSearchFieldSize(RenderStyle&) const; 154 void setSearchFieldSize(RenderStyle&) const;
155 155
156 NSPopUpButtonCell* popupButton() const; 156 NSPopUpButtonCell* popupButton() const;
157 NSSearchFieldCell* search() const; 157 NSSearchFieldCell* search() const;
158 NSTextFieldCell* textField() const; 158 NSTextFieldCell* textField() const;
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(const RenderStyle&) const; 163 int minimumProgressBarHeight(const 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(LayoutObject*, const PaintInfo&, const Int Rect&) override;
170 virtual bool paintMediaOverlayPlayButton(RenderObject*, const PaintInfo&, co nst IntRect&) override; 170 virtual bool paintMediaOverlayPlayButton(LayoutObject*, const PaintInfo&, co nst IntRect&) override;
171 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const Int Rect&) override; 171 virtual bool paintMediaMuteButton(LayoutObject*, const PaintInfo&, const Int Rect&) override;
172 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const In tRect&) override; 172 virtual bool paintMediaSliderTrack(LayoutObject*, 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(LayoutObject*, const PaintInfo&, const In tRect&) override;
176 virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo& , const IntRect&) override; 176 virtual bool paintMediaVolumeSliderContainer(LayoutObject*, const PaintInfo& , const IntRect&) override;
177 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, co nst IntRect&) override; 177 virtual bool paintMediaVolumeSliderTrack(LayoutObject*, const PaintInfo&, co nst IntRect&) override;
178 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co nst IntRect&) override; 178 virtual bool paintMediaVolumeSliderThumb(LayoutObject*, 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(LayoutObject*, const PaintInfo&, con st IntRect&) override;
182 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint Info&, const IntRect&) override; 182 virtual bool paintMediaToggleClosedCaptionsButton(LayoutObject*, 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(LayoutObject*) const;
188 188
189 virtual bool shouldUseFallbackTheme(const RenderStyle&) const override; 189 virtual bool shouldUseFallbackTheme(const RenderStyle&) const override;
190 190
191 private: 191 private:
192 virtual void updateActiveState(NSCell*, const RenderObject*); 192 virtual void updateActiveState(NSCell*, const LayoutObject*);
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<LayoutThemeNotificationObserver> m_notificationObserver; 204 RetainPtr<LayoutThemeNotificationObserver> m_notificationObserver;
205 }; 205 };
206 206
207 } // namespace blink 207 } // namespace blink
208 208
209 #endif // LayoutThemeChromiumMac_h 209 #endif // LayoutThemeChromiumMac_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutThemeChromiumDefault.cpp ('k') | Source/core/layout/LayoutThemeChromiumMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698