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 } |
| 282 |
274 void MediaControlOverlayPlayButtonElement::updateDisplayType() | 283 void MediaControlOverlayPlayButtonElement::updateDisplayType() |
275 { | 284 { |
276 if (mediaElement().togglePlayStateWillPlay()) { | 285 if (mediaElement().togglePlayStateWillPlay()) { |
277 show(); | 286 show(); |
278 } else | 287 } else |
279 hide(); | 288 hide(); |
280 } | 289 } |
281 | 290 |
282 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const | 291 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const |
283 { | 292 { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 float fontSize = smallestDimension * 0.05f; | 675 float fontSize = smallestDimension * 0.05f; |
667 if (fontSize != m_fontSize) { | 676 if (fontSize != m_fontSize) { |
668 m_fontSize = fontSize; | 677 m_fontSize = fontSize; |
669 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); | 678 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); |
670 } | 679 } |
671 } | 680 } |
672 | 681 |
673 // ---------------------------- | 682 // ---------------------------- |
674 | 683 |
675 } // namespace WebCore | 684 } // namespace WebCore |
OLD | NEW |