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 15 matching lines...) Expand all Loading... | |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #ifndef MediaControlElementTypes_h | 30 #ifndef MediaControlElementTypes_h |
31 #define MediaControlElementTypes_h | 31 #define MediaControlElementTypes_h |
32 | 32 |
33 #include "core/html/HTMLDivElement.h" | 33 #include "core/html/HTMLDivElement.h" |
34 #include "core/html/HTMLInputElement.h" | 34 #include "core/html/HTMLInputElement.h" |
35 #include "core/html/HTMLMediaElement.h" | 35 #include "core/html/HTMLMediaElement.h" |
36 #include "core/html/MediaControllerInterface.h" | |
37 #include "core/rendering/RenderBlock.h" | 36 #include "core/rendering/RenderBlock.h" |
38 | 37 |
39 namespace WebCore { | 38 namespace WebCore { |
40 | 39 |
40 class HTMLMediaElement; | |
41 class MediaControllerInterface; | |
42 | |
41 enum MediaControlElementType { | 43 enum MediaControlElementType { |
42 MediaEnterFullscreenButton = 0, | 44 MediaEnterFullscreenButton = 0, |
43 MediaMuteButton, | 45 MediaMuteButton, |
44 MediaPlayButton, | 46 MediaPlayButton, |
45 MediaSlider, | 47 MediaSlider, |
46 MediaSliderThumb, | 48 MediaSliderThumb, |
47 MediaShowClosedCaptionsButton, | 49 MediaShowClosedCaptionsButton, |
48 MediaHideClosedCaptionsButton, | 50 MediaHideClosedCaptionsButton, |
49 MediaUnMuteButton, | 51 MediaUnMuteButton, |
50 MediaPauseButton, | 52 MediaPauseButton, |
(...skipping 20 matching lines...) Expand all Loading... | |
71 | 73 |
72 // ---------------------------- | 74 // ---------------------------- |
73 | 75 |
74 class MediaControlElement { | 76 class MediaControlElement { |
75 public: | 77 public: |
76 void hide(); | 78 void hide(); |
77 void show(); | 79 void show(); |
78 | 80 |
79 MediaControlElementType displayType() { return m_displayType; } | 81 MediaControlElementType displayType() { return m_displayType; } |
80 | 82 |
81 void setMediaController(MediaControllerInterface* controller) { m_mediaContr oller = controller; } | |
82 MediaControllerInterface* mediaController() const { return m_mediaController ; } | |
83 | |
84 protected: | 83 protected: |
85 explicit MediaControlElement(MediaControlElementType, HTMLElement*); | 84 explicit MediaControlElement(HTMLMediaElement&, MediaControlElementType, HTM LElement*); |
acolwell GONE FROM CHROMIUM
2014/03/12 00:22:32
Drop explicit since this isn't a 1 arg constructor
philipj_slow
2014/03/12 04:30:11
Done.
| |
86 ~MediaControlElement() { } | 85 ~MediaControlElement() { } |
87 | 86 |
88 void setDisplayType(MediaControlElementType); | 87 void setDisplayType(MediaControlElementType); |
89 | 88 |
89 MediaControllerInterface& mediaControllerInterface() const; | |
90 | |
91 HTMLMediaElement& m_mediaElement; | |
acolwell GONE FROM CHROMIUM
2014/03/12 00:22:32
Why does this need to be protected instead of priv
philipj_slow
2014/03/12 04:30:11
Oops, that was needed for a following patch, but I
| |
92 | |
90 private: | 93 private: |
91 MediaControllerInterface* m_mediaController; | |
92 MediaControlElementType m_displayType; | 94 MediaControlElementType m_displayType; |
93 HTMLElement* m_element; | 95 HTMLElement* m_element; |
94 }; | 96 }; |
95 | 97 |
96 // ---------------------------- | 98 // ---------------------------- |
97 | 99 |
98 class MediaControlDivElement : public HTMLDivElement, public MediaControlElement { | 100 class MediaControlDivElement : public HTMLDivElement, public MediaControlElement { |
99 protected: | 101 protected: |
100 virtual bool isMediaControlElement() const OVERRIDE FINAL { return true; } | 102 virtual bool isMediaControlElement() const OVERRIDE FINAL { return true; } |
101 explicit MediaControlDivElement(Document&, MediaControlElementType); | 103 explicit MediaControlDivElement(HTMLMediaElement&, MediaControlElementType); |
acolwell GONE FROM CHROMIUM
2014/03/12 00:22:32
nit: drop explicit here and other cases of non-sin
philipj_slow
2014/03/12 04:30:11
Done.
| |
102 }; | 104 }; |
103 | 105 |
104 // ---------------------------- | 106 // ---------------------------- |
105 | 107 |
106 class MediaControlInputElement : public HTMLInputElement, public MediaControlEle ment { | 108 class MediaControlInputElement : public HTMLInputElement, public MediaControlEle ment { |
107 protected: | 109 protected: |
108 virtual bool isMediaControlElement() const OVERRIDE FINAL { return true; } | 110 virtual bool isMediaControlElement() const OVERRIDE FINAL { return true; } |
109 explicit MediaControlInputElement(Document&, MediaControlElementType); | 111 explicit MediaControlInputElement(HTMLMediaElement&, MediaControlElementType ); |
110 | 112 |
111 private: | 113 private: |
112 virtual void updateDisplayType() { } | 114 virtual void updateDisplayType() { } |
113 virtual bool isMouseFocusable() const OVERRIDE; | 115 virtual bool isMouseFocusable() const OVERRIDE; |
114 }; | 116 }; |
115 | 117 |
116 // ---------------------------- | 118 // ---------------------------- |
117 | 119 |
118 class MediaControlTimeDisplayElement : public MediaControlDivElement { | 120 class MediaControlTimeDisplayElement : public MediaControlDivElement { |
119 public: | 121 public: |
120 void setCurrentValue(double); | 122 void setCurrentValue(double); |
121 double currentValue() const { return m_currentValue; } | 123 double currentValue() const { return m_currentValue; } |
122 | 124 |
123 protected: | 125 protected: |
124 explicit MediaControlTimeDisplayElement(Document&, MediaControlElementType); | 126 explicit MediaControlTimeDisplayElement(HTMLMediaElement&, MediaControlEleme ntType); |
125 | 127 |
126 private: | 128 private: |
127 double m_currentValue; | 129 double m_currentValue; |
128 }; | 130 }; |
129 | 131 |
130 } // namespace WebCore | 132 } // namespace WebCore |
131 | 133 |
132 #endif // MediaControlElementTypes_h | 134 #endif // MediaControlElementTypes_h |
OLD | NEW |