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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 } | 124 } |
125 | 125 |
126 void MediaControlPanelElement::transitionTimerFired(Timer<MediaControlPanelEleme nt>*) | 126 void MediaControlPanelElement::transitionTimerFired(Timer<MediaControlPanelEleme nt>*) |
127 { | 127 { |
128 if (!m_opaque) | 128 if (!m_opaque) |
129 hide(); | 129 hide(); |
130 | 130 |
131 stopTimer(); | 131 stopTimer(); |
132 } | 132 } |
133 | 133 |
134 void MediaControlPanelElement::didBecomeVisible() | |
135 { | |
136 ASSERT(m_isDisplayed && m_opaque); | |
137 mediaElement().mediaControlsDidBecomeVisible(); | |
138 } | |
139 | |
134 void MediaControlPanelElement::makeOpaque() | 140 void MediaControlPanelElement::makeOpaque() |
135 { | 141 { |
136 if (m_opaque) | 142 if (m_opaque) |
137 return; | 143 return; |
138 | 144 |
139 setInlineStyleProperty(CSSPropertyOpacity, 1.0, CSSPrimitiveValue::CSS_NUMBE R); | 145 setInlineStyleProperty(CSSPropertyOpacity, 1.0, CSSPrimitiveValue::CSS_NUMBE R); |
140 m_opaque = true; | 146 m_opaque = true; |
141 | 147 |
142 if (m_isDisplayed) | 148 if (m_isDisplayed) { |
143 show(); | 149 show(); |
150 didBecomeVisible(); | |
151 } | |
144 } | 152 } |
145 | 153 |
146 void MediaControlPanelElement::makeTransparent() | 154 void MediaControlPanelElement::makeTransparent() |
147 { | 155 { |
148 if (!m_opaque) | 156 if (!m_opaque) |
149 return; | 157 return; |
150 | 158 |
151 setInlineStyleProperty(CSSPropertyOpacity, 0.0, CSSPrimitiveValue::CSS_NUMBE R); | 159 setInlineStyleProperty(CSSPropertyOpacity, 0.0, CSSPrimitiveValue::CSS_NUMBE R); |
152 | 160 |
153 m_opaque = false; | 161 m_opaque = false; |
154 startTimer(); | 162 startTimer(); |
155 } | 163 } |
156 | 164 |
157 void MediaControlPanelElement::setIsDisplayed(bool isDisplayed) | 165 void MediaControlPanelElement::setIsDisplayed(bool isDisplayed) |
158 { | 166 { |
167 if (m_isDisplayed == isDisplayed) | |
168 return; | |
169 | |
159 m_isDisplayed = isDisplayed; | 170 m_isDisplayed = isDisplayed; |
171 if (m_isDisplayed && m_opaque) { | |
fs
2015/03/20 09:58:54
Nit: Unneeded {}
philipj_slow
2015/03/20 16:46:33
Oops.
| |
172 didBecomeVisible(); | |
173 } | |
160 } | 174 } |
161 | 175 |
162 bool MediaControlPanelElement::keepEventInNode(Event* event) | 176 bool MediaControlPanelElement::keepEventInNode(Event* event) |
163 { | 177 { |
164 return isUserInteractionEvent(event); | 178 return isUserInteractionEvent(event); |
165 } | 179 } |
166 | 180 |
167 // ---------------------------- | 181 // ---------------------------- |
168 | 182 |
169 MediaControlPanelEnclosureElement::MediaControlPanelEnclosureElement(MediaContro ls& mediaControls) | 183 MediaControlPanelEnclosureElement::MediaControlPanelEnclosureElement(MediaContro ls& mediaControls) |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
592 } | 606 } |
593 | 607 |
594 PassRefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurren tTimeDisplayElement::create(MediaControls& mediaControls) | 608 PassRefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurren tTimeDisplayElement::create(MediaControls& mediaControls) |
595 { | 609 { |
596 RefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> element = adoptRef WillBeNoop(new MediaControlCurrentTimeDisplayElement(mediaControls)); | 610 RefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> element = adoptRef WillBeNoop(new MediaControlCurrentTimeDisplayElement(mediaControls)); |
597 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time -display", AtomicString::ConstructFromLiteral)); | 611 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time -display", AtomicString::ConstructFromLiteral)); |
598 return element.release(); | 612 return element.release(); |
599 } | 613 } |
600 | 614 |
601 } // namespace blink | 615 } // namespace blink |
OLD | NEW |