OLD | NEW |
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 CORE_EXPORT const HTMLMediaElement* toParentMediaElement(const Node*); | 73 CORE_EXPORT const HTMLMediaElement* toParentMediaElement(const Node*); |
74 CORE_EXPORT const HTMLMediaElement* toParentMediaElement(const LayoutObject&); | 74 CORE_EXPORT const HTMLMediaElement* toParentMediaElement(const LayoutObject&); |
75 | 75 |
76 CORE_EXPORT MediaControlElementType mediaControlElementType(const Node*); | 76 CORE_EXPORT MediaControlElementType mediaControlElementType(const Node*); |
77 | 77 |
78 // ---------------------------- | 78 // ---------------------------- |
79 | 79 |
80 // TODO(mustaq): The Media control elements that use MouseEvents should be | 80 // TODO(mustaq): The Media control elements that use MouseEvents should be |
81 // ported to use PointerEvents instead. | 81 // ported to use PointerEvents instead. |
82 class MediaControlElement : public GarbageCollectedMixin { | 82 class CORE_EXPORT MediaControlElement : public GarbageCollectedMixin { |
83 public: | 83 public: |
84 // These hold the state about whether this control should be shown if | 84 // These hold the state about whether this control should be shown if |
85 // space permits. These will also show / hide as needed. | 85 // space permits. These will also show / hide as needed. |
86 virtual void setIsWanted(bool); | 86 virtual void setIsWanted(bool); |
87 bool isWanted(); | 87 bool isWanted(); |
88 | 88 |
89 // Tell us whether we fit or not. This will hide / show the control as | 89 // Tell us whether we fit or not. This will hide / show the control as |
90 // needed, also. | 90 // needed, also. |
91 void setDoesFit(bool); | 91 void setDoesFit(bool); |
92 | 92 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 Member<MediaControls> m_mediaControls; | 145 Member<MediaControls> m_mediaControls; |
146 MediaControlElementType m_displayType; | 146 MediaControlElementType m_displayType; |
147 Member<HTMLElement> m_element; | 147 Member<HTMLElement> m_element; |
148 bool m_isWanted : 1; | 148 bool m_isWanted : 1; |
149 bool m_doesFit : 1; | 149 bool m_doesFit : 1; |
150 }; | 150 }; |
151 | 151 |
152 // ---------------------------- | 152 // ---------------------------- |
153 | 153 |
154 class MediaControlDivElement : public HTMLDivElement, | 154 class CORE_EXPORT MediaControlDivElement : public HTMLDivElement, |
155 public MediaControlElement { | 155 public MediaControlElement { |
156 USING_GARBAGE_COLLECTED_MIXIN(MediaControlDivElement); | 156 USING_GARBAGE_COLLECTED_MIXIN(MediaControlDivElement); |
157 | 157 |
158 public: | 158 public: |
159 DECLARE_VIRTUAL_TRACE(); | 159 DECLARE_VIRTUAL_TRACE(); |
160 | 160 |
161 protected: | 161 protected: |
162 MediaControlDivElement(MediaControls&, MediaControlElementType); | 162 MediaControlDivElement(MediaControls&, MediaControlElementType); |
163 | 163 |
164 private: | 164 private: |
165 bool isMediaControlElement() const final { return true; } | 165 bool isMediaControlElement() const final { return true; } |
166 }; | 166 }; |
167 | 167 |
168 // ---------------------------- | 168 // ---------------------------- |
169 | 169 |
170 class MediaControlInputElement : public HTMLInputElement, | 170 class CORE_EXPORT MediaControlInputElement : public HTMLInputElement, |
171 public MediaControlElement { | 171 public MediaControlElement { |
172 USING_GARBAGE_COLLECTED_MIXIN(MediaControlInputElement); | 172 USING_GARBAGE_COLLECTED_MIXIN(MediaControlInputElement); |
173 | 173 |
174 public: | 174 public: |
175 DECLARE_VIRTUAL_TRACE(); | 175 DECLARE_VIRTUAL_TRACE(); |
176 | 176 |
177 // Creates an overflow menu element with the given button as a child. | 177 // Creates an overflow menu element with the given button as a child. |
178 HTMLElement* createOverflowElement(MediaControls&, MediaControlInputElement*); | 178 HTMLElement* createOverflowElement(MediaControls&, MediaControlInputElement*); |
179 | 179 |
180 protected: | 180 protected: |
181 MediaControlInputElement(MediaControls&, MediaControlElementType); | 181 MediaControlInputElement(MediaControls&, MediaControlElementType); |
182 | 182 |
183 private: | 183 private: |
184 virtual void updateDisplayType() {} | 184 virtual void updateDisplayType() {} |
185 bool isMediaControlElement() const final { return true; } | 185 bool isMediaControlElement() const final { return true; } |
186 bool isMouseFocusable() const override; | 186 bool isMouseFocusable() const override; |
187 | 187 |
188 // Creates an overflow menu HTML element. | 188 // Creates an overflow menu HTML element. |
189 virtual MediaControlInputElement* createOverflowButton(MediaControls&) { | 189 virtual MediaControlInputElement* createOverflowButton(MediaControls&) { |
190 return nullptr; | 190 return nullptr; |
191 } | 191 } |
192 }; | 192 }; |
193 | 193 |
194 // ---------------------------- | 194 // ---------------------------- |
195 | 195 |
196 class MediaControlTimeDisplayElement : public MediaControlDivElement { | 196 class CORE_EXPORT MediaControlTimeDisplayElement |
| 197 : public MediaControlDivElement { |
197 public: | 198 public: |
198 void setCurrentValue(double); | 199 void setCurrentValue(double); |
199 double currentValue() const { return m_currentValue; } | 200 double currentValue() const { return m_currentValue; } |
200 | 201 |
201 protected: | 202 protected: |
202 MediaControlTimeDisplayElement(MediaControls&, MediaControlElementType); | 203 MediaControlTimeDisplayElement(MediaControls&, MediaControlElementType); |
203 | 204 |
204 private: | 205 private: |
205 double m_currentValue; | 206 double m_currentValue; |
206 }; | 207 }; |
207 | 208 |
208 } // namespace blink | 209 } // namespace blink |
209 | 210 |
210 #endif // MediaControlElementTypes_h | 211 #endif // MediaControlElementTypes_h |
OLD | NEW |