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

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

Issue 195473002: Let MediaControls use the parent HTMLMediaElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Give MediaControls to MediaControlElements Created 6 years, 9 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(MediaControls&);
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(MediaControls&);
55 55
56 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 56 virtual const AtomicString& shadowPseudoId() 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(MediaControls&);
84 84
85 private: 85 private:
86 explicit MediaControlPanelEnclosureElement(Document&); 86 explicit MediaControlPanelEnclosureElement(MediaControls&);
87 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 87 virtual const AtomicString& shadowPseudoId() 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(MediaControls& );
95 95
96 private: 96 private:
97 explicit MediaControlOverlayEnclosureElement(Document&); 97 explicit MediaControlOverlayEnclosureElement(MediaControls&);
98 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 98 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
99 }; 99 };
100 100
101 // ---------------------------- 101 // ----------------------------
102 102
103 class MediaControlMuteButtonElement FINAL : public MediaControlInputElement { 103 class MediaControlMuteButtonElement FINAL : public MediaControlInputElement {
104 public: 104 public:
105 static PassRefPtr<MediaControlMuteButtonElement> create(Document&); 105 static PassRefPtr<MediaControlMuteButtonElement> create(MediaControls&);
106 106
107 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 107 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
108 virtual void updateDisplayType() OVERRIDE; 108 virtual void updateDisplayType() OVERRIDE;
109 109
110 private: 110 private:
111 explicit MediaControlMuteButtonElement(Document&); 111 explicit MediaControlMuteButtonElement(MediaControls&);
112 112
113 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 113 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
114 virtual void defaultEventHandler(Event*) OVERRIDE; 114 virtual void defaultEventHandler(Event*) OVERRIDE;
115 }; 115 };
116 116
117 // ---------------------------- 117 // ----------------------------
118 118
119 class MediaControlPlayButtonElement FINAL : public MediaControlInputElement { 119 class MediaControlPlayButtonElement FINAL : public MediaControlInputElement {
120 public: 120 public:
121 static PassRefPtr<MediaControlPlayButtonElement> create(Document&); 121 static PassRefPtr<MediaControlPlayButtonElement> create(MediaControls&);
122 122
123 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 123 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
124 virtual void updateDisplayType() OVERRIDE; 124 virtual void updateDisplayType() OVERRIDE;
125 125
126 private: 126 private:
127 explicit MediaControlPlayButtonElement(Document&); 127 explicit MediaControlPlayButtonElement(MediaControls&);
128 128
129 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 129 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
130 virtual void defaultEventHandler(Event*) OVERRIDE; 130 virtual void defaultEventHandler(Event*) OVERRIDE;
131 }; 131 };
132 132
133 // ---------------------------- 133 // ----------------------------
134 134
135 class MediaControlOverlayPlayButtonElement FINAL : public MediaControlInputEleme nt { 135 class MediaControlOverlayPlayButtonElement FINAL : public MediaControlInputEleme nt {
136 public: 136 public:
137 static PassRefPtr<MediaControlOverlayPlayButtonElement> create(Document&); 137 static PassRefPtr<MediaControlOverlayPlayButtonElement> create(MediaControls &);
138 138
139 virtual void updateDisplayType() OVERRIDE; 139 virtual void updateDisplayType() OVERRIDE;
140 140
141 private: 141 private:
142 explicit MediaControlOverlayPlayButtonElement(Document&); 142 explicit MediaControlOverlayPlayButtonElement(MediaControls&);
143 143
144 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 144 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
145 virtual void defaultEventHandler(Event*) OVERRIDE; 145 virtual void defaultEventHandler(Event*) OVERRIDE;
146 }; 146 };
147 147
148 // ---------------------------- 148 // ----------------------------
149 149
150 class MediaControlToggleClosedCaptionsButtonElement FINAL : public MediaControlI nputElement { 150 class MediaControlToggleClosedCaptionsButtonElement FINAL : public MediaControlI nputElement {
151 public: 151 public:
152 static PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> create(Docu ment&); 152 static PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> create(Medi aControls&);
153 153
154 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 154 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
155 155
156 virtual void updateDisplayType() OVERRIDE; 156 virtual void updateDisplayType() OVERRIDE;
157 157
158 private: 158 private:
159 explicit MediaControlToggleClosedCaptionsButtonElement(Document&); 159 explicit MediaControlToggleClosedCaptionsButtonElement(MediaControls&);
160 160
161 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 161 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
162 virtual void defaultEventHandler(Event*) OVERRIDE; 162 virtual void defaultEventHandler(Event*) OVERRIDE;
163 }; 163 };
164 164
165 // ---------------------------- 165 // ----------------------------
166 166
167 class MediaControlTimelineElement FINAL : public MediaControlInputElement { 167 class MediaControlTimelineElement FINAL : public MediaControlInputElement {
168 public: 168 public:
169 static PassRefPtr<MediaControlTimelineElement> create(Document&, MediaContro ls*); 169 static PassRefPtr<MediaControlTimelineElement> create(MediaControls&);
170 170
171 virtual bool willRespondToMouseClickEvents() OVERRIDE; 171 virtual bool willRespondToMouseClickEvents() OVERRIDE;
172 172
173 void setPosition(double); 173 void setPosition(double);
174 void setDuration(double); 174 void setDuration(double);
175 175
176 private: 176 private:
177 explicit MediaControlTimelineElement(Document&, MediaControls*); 177 explicit MediaControlTimelineElement(MediaControls&);
178 178
179 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 179 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
180 virtual void defaultEventHandler(Event*) OVERRIDE; 180 virtual void defaultEventHandler(Event*) OVERRIDE;
181
182 MediaControls* m_controls;
183 }; 181 };
184 182
185 // ---------------------------- 183 // ----------------------------
186 184
187 class MediaControlFullscreenButtonElement FINAL : public MediaControlInputElemen t { 185 class MediaControlFullscreenButtonElement FINAL : public MediaControlInputElemen t {
188 public: 186 public:
189 static PassRefPtr<MediaControlFullscreenButtonElement> create(Document&); 187 static PassRefPtr<MediaControlFullscreenButtonElement> create(MediaControls& );
190 188
191 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 189 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
192 190
193 void setIsFullscreen(bool); 191 void setIsFullscreen(bool);
194 192
195 private: 193 private:
196 explicit MediaControlFullscreenButtonElement(Document&); 194 explicit MediaControlFullscreenButtonElement(MediaControls&);
197 195
198 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 196 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
199 virtual void defaultEventHandler(Event*) OVERRIDE; 197 virtual void defaultEventHandler(Event*) OVERRIDE;
200 }; 198 };
201 199
202 // ---------------------------- 200 // ----------------------------
203 201
204 class MediaControlVolumeSliderElement FINAL : public MediaControlInputElement { 202 class MediaControlVolumeSliderElement FINAL : public MediaControlInputElement {
205 public: 203 public:
206 static PassRefPtr<MediaControlVolumeSliderElement> create(Document&); 204 static PassRefPtr<MediaControlVolumeSliderElement> create(MediaControls&);
207 205
208 virtual bool willRespondToMouseMoveEvents() OVERRIDE; 206 virtual bool willRespondToMouseMoveEvents() OVERRIDE;
209 virtual bool willRespondToMouseClickEvents() OVERRIDE; 207 virtual bool willRespondToMouseClickEvents() OVERRIDE;
210 void setVolume(double); 208 void setVolume(double);
211 209
212 private: 210 private:
213 explicit MediaControlVolumeSliderElement(Document&); 211 explicit MediaControlVolumeSliderElement(MediaControls&);
214 212
215 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 213 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
216 virtual void defaultEventHandler(Event*) OVERRIDE; 214 virtual void defaultEventHandler(Event*) OVERRIDE;
217 }; 215 };
218 216
219 // ---------------------------- 217 // ----------------------------
220 218
221 class MediaControlTimeRemainingDisplayElement FINAL : public MediaControlTimeDis playElement { 219 class MediaControlTimeRemainingDisplayElement FINAL : public MediaControlTimeDis playElement {
222 public: 220 public:
223 static PassRefPtr<MediaControlTimeRemainingDisplayElement> create(Document&) ; 221 static PassRefPtr<MediaControlTimeRemainingDisplayElement> create(MediaContr ols&);
224 222
225 private: 223 private:
226 explicit MediaControlTimeRemainingDisplayElement(Document&); 224 explicit MediaControlTimeRemainingDisplayElement(MediaControls&);
227 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 225 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
228 }; 226 };
229 227
230 // ---------------------------- 228 // ----------------------------
231 229
232 class MediaControlCurrentTimeDisplayElement FINAL : public MediaControlTimeDispl ayElement { 230 class MediaControlCurrentTimeDisplayElement FINAL : public MediaControlTimeDispl ayElement {
233 public: 231 public:
234 static PassRefPtr<MediaControlCurrentTimeDisplayElement> create(Document&); 232 static PassRefPtr<MediaControlCurrentTimeDisplayElement> create(MediaControl s&);
235 233
236 private: 234 private:
237 explicit MediaControlCurrentTimeDisplayElement(Document&); 235 explicit MediaControlCurrentTimeDisplayElement(MediaControls&);
238 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 236 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
239 }; 237 };
240 238
241 // ---------------------------- 239 // ----------------------------
242 240
243 class MediaControlTextTrackContainerElement FINAL : public MediaControlDivElemen t { 241 class MediaControlTextTrackContainerElement FINAL : public MediaControlDivElemen t {
244 public: 242 public:
245 static PassRefPtr<MediaControlTextTrackContainerElement> create(Document&); 243 static PassRefPtr<MediaControlTextTrackContainerElement> create(MediaControl s&);
246 244
247 void updateDisplay(); 245 void updateDisplay();
248 void updateSizes(); 246 void updateSizes();
249 static const AtomicString& textTrackContainerElementShadowPseudoId(); 247 static const AtomicString& textTrackContainerElementShadowPseudoId();
250 248
251 private: 249 private:
252 explicit MediaControlTextTrackContainerElement(Document&); 250 explicit MediaControlTextTrackContainerElement(MediaControls&);
253 virtual const AtomicString& shadowPseudoId() const OVERRIDE; 251 virtual const AtomicString& shadowPseudoId() const OVERRIDE;
254 252
255 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; 253 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
256 254
257 IntRect m_videoDisplaySize; 255 IntRect m_videoDisplaySize;
258 float m_fontSize; 256 float m_fontSize;
259 }; 257 };
260 258
261 259
262 } // namespace WebCore 260 } // namespace WebCore
263 261
264 #endif // MediaControlElements_h 262 #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