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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 | 265 |
266 PassRefPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlayPlayButtonEl
ement::create(MediaControls& mediaControls) | 266 PassRefPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlayPlayButtonEl
ement::create(MediaControls& mediaControls) |
267 { | 267 { |
268 RefPtr<MediaControlOverlayPlayButtonElement> button = adoptRef(new MediaCont
rolOverlayPlayButtonElement(mediaControls)); | 268 RefPtr<MediaControlOverlayPlayButtonElement> button = adoptRef(new MediaCont
rolOverlayPlayButtonElement(mediaControls)); |
269 button->ensureUserAgentShadowRoot(); | 269 button->ensureUserAgentShadowRoot(); |
270 button->setType("button"); | 270 button->setType("button"); |
271 return button.release(); | 271 return button.release(); |
272 } | 272 } |
273 | 273 |
274 void MediaControlOverlayPlayButtonElement::defaultEventHandler(Event* event) | |
275 { | |
276 if (event->type() == EventTypeNames::click && mediaElement().togglePlayState
WillPlay()) { | |
277 mediaElement().togglePlayState(); | |
278 updateDisplayType(); | |
279 event->setDefaultHandled(); | |
280 } | |
281 HTMLInputElement::defaultEventHandler(event); | |
282 } | |
283 | |
284 void MediaControlOverlayPlayButtonElement::updateDisplayType() | 274 void MediaControlOverlayPlayButtonElement::updateDisplayType() |
285 { | 275 { |
286 if (mediaElement().togglePlayStateWillPlay()) { | 276 if (mediaElement().togglePlayStateWillPlay()) { |
287 show(); | 277 show(); |
288 } else | 278 } else |
289 hide(); | 279 hide(); |
290 } | 280 } |
291 | 281 |
292 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const | 282 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const |
293 { | 283 { |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 float fontSize = smallestDimension * 0.05f; | 664 float fontSize = smallestDimension * 0.05f; |
675 if (fontSize != m_fontSize) { | 665 if (fontSize != m_fontSize) { |
676 m_fontSize = fontSize; | 666 m_fontSize = fontSize; |
677 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); | 667 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); |
678 } | 668 } |
679 } | 669 } |
680 | 670 |
681 // ---------------------------- | 671 // ---------------------------- |
682 | 672 |
683 } // namespace WebCore | 673 } // namespace WebCore |
OLD | NEW |