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

Side by Side Diff: Source/core/html/shadow/MediaControlElements.h

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 20 matching lines...) Expand all
31 #define MediaControlElements_h 31 #define MediaControlElements_h
32 32
33 #include "core/html/shadow/MediaControlElementTypes.h" 33 #include "core/html/shadow/MediaControlElementTypes.h"
34 34
35 namespace WebCore { 35 namespace WebCore {
36 36
37 // ---------------------------- 37 // ----------------------------
38 38
39 class MediaControlPanelElement FINAL : public MediaControlDivElement { 39 class MediaControlPanelElement FINAL : public MediaControlDivElement {
40 public: 40 public:
41 static PassRefPtr<MediaControlPanelElement> create(Document*); 41 static PassRefPtr<MediaControlPanelElement> create(Document&);
42 42
43 void setCanBeDragged(bool); 43 void setCanBeDragged(bool);
44 void setIsDisplayed(bool); 44 void setIsDisplayed(bool);
45 45
46 void resetPosition(); 46 void resetPosition();
47 void makeOpaque(); 47 void makeOpaque();
48 void makeTransparent(); 48 void makeTransparent();
49 49
50 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } 50 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; }
51 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 51 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
52 52
53 private: 53 private:
54 explicit MediaControlPanelElement(Document*); 54 explicit MediaControlPanelElement(Document&);
55 55
56 virtual const AtomicString& part() const OVERRIDE; 56 virtual const AtomicString& part() const OVERRIDE;
57 virtual void defaultEventHandler(Event*) OVERRIDE; 57 virtual void defaultEventHandler(Event*) OVERRIDE;
58 58
59 void startDrag(const LayoutPoint& eventLocation); 59 void startDrag(const LayoutPoint& eventLocation);
60 void continueDrag(const LayoutPoint& eventLocation); 60 void continueDrag(const LayoutPoint& eventLocation);
61 void endDrag(); 61 void endDrag();
62 62
63 void startTimer(); 63 void startTimer();
64 void stopTimer(); 64 void stopTimer();
65 void transitionTimerFired(Timer<MediaControlPanelElement>*); 65 void transitionTimerFired(Timer<MediaControlPanelElement>*);
66 66
67 void setPosition(const LayoutPoint&); 67 void setPosition(const LayoutPoint&);
68 68
69 bool m_canBeDragged; 69 bool m_canBeDragged;
70 bool m_isBeingDragged; 70 bool m_isBeingDragged;
71 bool m_isDisplayed; 71 bool m_isDisplayed;
72 bool m_opaque; 72 bool m_opaque;
73 LayoutPoint m_lastDragEventLocation; 73 LayoutPoint m_lastDragEventLocation;
74 LayoutPoint m_cumulativeDragOffset; 74 LayoutPoint m_cumulativeDragOffset;
75 75
76 Timer<MediaControlPanelElement> m_transitionTimer; 76 Timer<MediaControlPanelElement> m_transitionTimer;
77 }; 77 };
78 78
79 // ---------------------------- 79 // ----------------------------
80 80
81 class MediaControlPanelEnclosureElement FINAL : public MediaControlDivElement { 81 class MediaControlPanelEnclosureElement FINAL : public MediaControlDivElement {
82 public: 82 public:
83 static PassRefPtr<MediaControlPanelEnclosureElement> create(Document*); 83 static PassRefPtr<MediaControlPanelEnclosureElement> create(Document&);
84 84
85 private: 85 private:
86 explicit MediaControlPanelEnclosureElement(Document*); 86 explicit MediaControlPanelEnclosureElement(Document&);
87 virtual const AtomicString& part() const OVERRIDE; 87 virtual const AtomicString& part() const OVERRIDE;
88 }; 88 };
89 89
90 // ---------------------------- 90 // ----------------------------
91 91
92 class MediaControlOverlayEnclosureElement FINAL : public MediaControlDivElement { 92 class MediaControlOverlayEnclosureElement FINAL : public MediaControlDivElement {
93 public: 93 public:
94 static PassRefPtr<MediaControlOverlayEnclosureElement> create(Document*); 94 static PassRefPtr<MediaControlOverlayEnclosureElement> create(Document&);
95 95
96 private: 96 private:
97 explicit MediaControlOverlayEnclosureElement(Document*); 97 explicit MediaControlOverlayEnclosureElement(Document&);
98 virtual const AtomicString& part() const OVERRIDE; 98 virtual const AtomicString& part() const OVERRIDE;
99 }; 99 };
100 100
101 // ---------------------------- 101 // ----------------------------
102 102
103 class MediaControlPanelMuteButtonElement FINAL : public MediaControlMuteButtonEl ement { 103 class MediaControlPanelMuteButtonElement FINAL : public MediaControlMuteButtonEl ement {
104 public: 104 public:
105 static PassRefPtr<MediaControlPanelMuteButtonElement> create(Document*, Medi aControls*); 105 static PassRefPtr<MediaControlPanelMuteButtonElement> create(Document&, Medi aControls*);
106 106
107 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } 107 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; }
108 108
109 private: 109 private:
110 explicit MediaControlPanelMuteButtonElement(Document*, MediaControls*); 110 explicit MediaControlPanelMuteButtonElement(Document&, MediaControls*);
111 111
112 virtual const AtomicString& part() const OVERRIDE; 112 virtual const AtomicString& part() const OVERRIDE;
113 virtual void defaultEventHandler(Event*) OVERRIDE; 113 virtual void defaultEventHandler(Event*) OVERRIDE;
114 114
115 MediaControls* m_controls; 115 MediaControls* m_controls;
116 }; 116 };
117 117
118 // ---------------------------- 118 // ----------------------------
119 119
120 class MediaControlVolumeSliderMuteButtonElement FINAL : public MediaControlMuteB uttonElement { 120 class MediaControlVolumeSliderMuteButtonElement FINAL : public MediaControlMuteB uttonElement {
121 public: 121 public:
122 static PassRefPtr<MediaControlVolumeSliderMuteButtonElement> create(Document *); 122 static PassRefPtr<MediaControlVolumeSliderMuteButtonElement> create(Document &);
123 123
124 private: 124 private:
125 explicit MediaControlVolumeSliderMuteButtonElement(Document*); 125 explicit MediaControlVolumeSliderMuteButtonElement(Document&);
126 virtual const AtomicString& part() const OVERRIDE; 126 virtual const AtomicString& part() const OVERRIDE;
127 }; 127 };
128 128
129 129
130 // ---------------------------- 130 // ----------------------------
131 131
132 class MediaControlPlayButtonElement FINAL : public MediaControlInputElement { 132 class MediaControlPlayButtonElement FINAL : public MediaControlInputElement {
133 public: 133 public:
134 static PassRefPtr<MediaControlPlayButtonElement> create(Document*); 134 static PassRefPtr<MediaControlPlayButtonElement> create(Document&);
135 135
136 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 136 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
137 virtual void updateDisplayType() OVERRIDE; 137 virtual void updateDisplayType() OVERRIDE;
138 138
139 private: 139 private:
140 explicit MediaControlPlayButtonElement(Document*); 140 explicit MediaControlPlayButtonElement(Document&);
141 141
142 virtual const AtomicString& part() const OVERRIDE; 142 virtual const AtomicString& part() const OVERRIDE;
143 virtual void defaultEventHandler(Event*) OVERRIDE; 143 virtual void defaultEventHandler(Event*) OVERRIDE;
144 }; 144 };
145 145
146 // ---------------------------- 146 // ----------------------------
147 147
148 class MediaControlOverlayPlayButtonElement FINAL : public MediaControlInputEleme nt { 148 class MediaControlOverlayPlayButtonElement FINAL : public MediaControlInputEleme nt {
149 public: 149 public:
150 static PassRefPtr<MediaControlOverlayPlayButtonElement> create(Document*); 150 static PassRefPtr<MediaControlOverlayPlayButtonElement> create(Document&);
151 151
152 virtual void updateDisplayType() OVERRIDE; 152 virtual void updateDisplayType() OVERRIDE;
153 153
154 private: 154 private:
155 explicit MediaControlOverlayPlayButtonElement(Document*); 155 explicit MediaControlOverlayPlayButtonElement(Document&);
156 156
157 virtual const AtomicString& part() const OVERRIDE; 157 virtual const AtomicString& part() const OVERRIDE;
158 virtual void defaultEventHandler(Event*) OVERRIDE; 158 virtual void defaultEventHandler(Event*) OVERRIDE;
159 }; 159 };
160 160
161 // ---------------------------- 161 // ----------------------------
162 162
163 class MediaControlToggleClosedCaptionsButtonElement FINAL : public MediaControlI nputElement { 163 class MediaControlToggleClosedCaptionsButtonElement FINAL : public MediaControlI nputElement {
164 public: 164 public:
165 static PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> create(Docu ment*, MediaControls*); 165 static PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> create(Docu ment&, MediaControls*);
166 166
167 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 167 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
168 168
169 virtual void updateDisplayType() OVERRIDE; 169 virtual void updateDisplayType() OVERRIDE;
170 170
171 private: 171 private:
172 explicit MediaControlToggleClosedCaptionsButtonElement(Document*, MediaContr ols*); 172 explicit MediaControlToggleClosedCaptionsButtonElement(Document&, MediaContr ols*);
173 173
174 virtual const AtomicString& part() const OVERRIDE; 174 virtual const AtomicString& part() const OVERRIDE;
175 virtual void defaultEventHandler(Event*) OVERRIDE; 175 virtual void defaultEventHandler(Event*) OVERRIDE;
176 }; 176 };
177 177
178 // ---------------------------- 178 // ----------------------------
179 179
180 class MediaControlTimelineElement FINAL : public MediaControlInputElement { 180 class MediaControlTimelineElement FINAL : public MediaControlInputElement {
181 public: 181 public:
182 static PassRefPtr<MediaControlTimelineElement> create(Document*, MediaContro ls*); 182 static PassRefPtr<MediaControlTimelineElement> create(Document&, MediaContro ls*);
183 183
184 virtual bool willRespondToMouseClickEvents() OVERRIDE; 184 virtual bool willRespondToMouseClickEvents() OVERRIDE;
185 185
186 void setPosition(double); 186 void setPosition(double);
187 void setDuration(double); 187 void setDuration(double);
188 188
189 private: 189 private:
190 explicit MediaControlTimelineElement(Document*, MediaControls*); 190 explicit MediaControlTimelineElement(Document&, MediaControls*);
191 191
192 virtual const AtomicString& part() const OVERRIDE; 192 virtual const AtomicString& part() const OVERRIDE;
193 virtual void defaultEventHandler(Event*) OVERRIDE; 193 virtual void defaultEventHandler(Event*) OVERRIDE;
194 194
195 MediaControls* m_controls; 195 MediaControls* m_controls;
196 }; 196 };
197 197
198 // ---------------------------- 198 // ----------------------------
199 199
200 class MediaControlFullscreenButtonElement FINAL : public MediaControlInputElemen t { 200 class MediaControlFullscreenButtonElement FINAL : public MediaControlInputElemen t {
201 public: 201 public:
202 static PassRefPtr<MediaControlFullscreenButtonElement> create(Document*); 202 static PassRefPtr<MediaControlFullscreenButtonElement> create(Document&);
203 203
204 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 204 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
205 205
206 virtual void setIsFullscreen(bool); 206 virtual void setIsFullscreen(bool);
207 207
208 private: 208 private:
209 explicit MediaControlFullscreenButtonElement(Document*); 209 explicit MediaControlFullscreenButtonElement(Document&);
210 210
211 virtual const AtomicString& part() const OVERRIDE; 211 virtual const AtomicString& part() const OVERRIDE;
212 virtual void defaultEventHandler(Event*) OVERRIDE; 212 virtual void defaultEventHandler(Event*) OVERRIDE;
213 }; 213 };
214 214
215 // ---------------------------- 215 // ----------------------------
216 216
217 class MediaControlPanelVolumeSliderElement FINAL : public MediaControlVolumeSlid erElement { 217 class MediaControlPanelVolumeSliderElement FINAL : public MediaControlVolumeSlid erElement {
218 public: 218 public:
219 static PassRefPtr<MediaControlPanelVolumeSliderElement> create(Document*); 219 static PassRefPtr<MediaControlPanelVolumeSliderElement> create(Document&);
220 220
221 private: 221 private:
222 explicit MediaControlPanelVolumeSliderElement(Document*); 222 explicit MediaControlPanelVolumeSliderElement(Document&);
223 virtual const AtomicString& part() const OVERRIDE; 223 virtual const AtomicString& part() const OVERRIDE;
224 }; 224 };
225 225
226 // ---------------------------- 226 // ----------------------------
227 227
228 class MediaControlTimeRemainingDisplayElement FINAL : public MediaControlTimeDis playElement { 228 class MediaControlTimeRemainingDisplayElement FINAL : public MediaControlTimeDis playElement {
229 public: 229 public:
230 static PassRefPtr<MediaControlTimeRemainingDisplayElement> create(Document*) ; 230 static PassRefPtr<MediaControlTimeRemainingDisplayElement> create(Document&) ;
231 231
232 private: 232 private:
233 explicit MediaControlTimeRemainingDisplayElement(Document*); 233 explicit MediaControlTimeRemainingDisplayElement(Document&);
234 virtual const AtomicString& part() const OVERRIDE; 234 virtual const AtomicString& part() const OVERRIDE;
235 }; 235 };
236 236
237 // ---------------------------- 237 // ----------------------------
238 238
239 class MediaControlCurrentTimeDisplayElement FINAL : public MediaControlTimeDispl ayElement { 239 class MediaControlCurrentTimeDisplayElement FINAL : public MediaControlTimeDispl ayElement {
240 public: 240 public:
241 static PassRefPtr<MediaControlCurrentTimeDisplayElement> create(Document*); 241 static PassRefPtr<MediaControlCurrentTimeDisplayElement> create(Document&);
242 242
243 private: 243 private:
244 explicit MediaControlCurrentTimeDisplayElement(Document*); 244 explicit MediaControlCurrentTimeDisplayElement(Document&);
245 virtual const AtomicString& part() const OVERRIDE; 245 virtual const AtomicString& part() const OVERRIDE;
246 }; 246 };
247 247
248 // ---------------------------- 248 // ----------------------------
249 249
250 class MediaControlTextTrackContainerElement FINAL : public MediaControlDivElemen t { 250 class MediaControlTextTrackContainerElement FINAL : public MediaControlDivElemen t {
251 public: 251 public:
252 static PassRefPtr<MediaControlTextTrackContainerElement> create(Document*); 252 static PassRefPtr<MediaControlTextTrackContainerElement> create(Document&);
253 253
254 void updateDisplay(); 254 void updateDisplay();
255 void updateSizes(bool forceUpdate = false); 255 void updateSizes(bool forceUpdate = false);
256 static const AtomicString& textTrackContainerElementShadowPseudoId(); 256 static const AtomicString& textTrackContainerElementShadowPseudoId();
257 257
258 private: 258 private:
259 explicit MediaControlTextTrackContainerElement(Document*); 259 explicit MediaControlTextTrackContainerElement(Document&);
260 virtual const AtomicString& part() const OVERRIDE; 260 virtual const AtomicString& part() const OVERRIDE;
261 261
262 virtual RenderObject* createRenderer(RenderStyle*); 262 virtual RenderObject* createRenderer(RenderStyle*);
263 263
264 IntRect m_videoDisplaySize; 264 IntRect m_videoDisplaySize;
265 float m_fontSize; 265 float m_fontSize;
266 }; 266 };
267 267
268 268
269 } // namespace WebCore 269 } // namespace WebCore
270 270
271 #endif // MediaControlElements_h 271 #endif // MediaControlElements_h
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControlElementTypes.cpp ('k') | Source/core/html/shadow/MediaControlElements.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698