| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 304 } |
| 305 | 305 |
| 306 PassRefPtrWillBeRawPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlay
PlayButtonElement::create(MediaControls& mediaControls) | 306 PassRefPtrWillBeRawPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlay
PlayButtonElement::create(MediaControls& mediaControls) |
| 307 { | 307 { |
| 308 RefPtrWillBeRawPtr<MediaControlOverlayPlayButtonElement> button = adoptRefWi
llBeNoop(new MediaControlOverlayPlayButtonElement(mediaControls)); | 308 RefPtrWillBeRawPtr<MediaControlOverlayPlayButtonElement> button = adoptRefWi
llBeNoop(new MediaControlOverlayPlayButtonElement(mediaControls)); |
| 309 button->ensureUserAgentShadowRoot(); | 309 button->ensureUserAgentShadowRoot(); |
| 310 button->setType(InputTypeNames::button); | 310 button->setType(InputTypeNames::button); |
| 311 return button.release(); | 311 return button.release(); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void MediaControlOverlayPlayButtonElement::defaultEventHandler(Event* event) | |
| 315 { | |
| 316 if (event->type() == EventTypeNames::click && mediaElement().togglePlayState
WillPlay()) { | |
| 317 mediaElement().togglePlayState(); | |
| 318 updateDisplayType(); | |
| 319 event->setDefaultHandled(); | |
| 320 } | |
| 321 } | |
| 322 | |
| 323 void MediaControlOverlayPlayButtonElement::updateDisplayType() | 314 void MediaControlOverlayPlayButtonElement::updateDisplayType() |
| 324 { | 315 { |
| 325 if (mediaElement().shouldShowControls() && mediaElement().togglePlayStateWil
lPlay()) | 316 if (mediaElement().shouldShowControls() && mediaElement().togglePlayStateWil
lPlay()) |
| 326 show(); | 317 show(); |
| 327 else | 318 else |
| 328 hide(); | 319 hide(); |
| 329 } | 320 } |
| 330 | 321 |
| 331 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const | 322 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const |
| 332 { | 323 { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 float fontSize = smallestDimension * 0.05f; | 778 float fontSize = smallestDimension * 0.05f; |
| 788 if (fontSize != m_fontSize) { | 779 if (fontSize != m_fontSize) { |
| 789 m_fontSize = fontSize; | 780 m_fontSize = fontSize; |
| 790 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); | 781 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); |
| 791 } | 782 } |
| 792 } | 783 } |
| 793 | 784 |
| 794 // ---------------------------- | 785 // ---------------------------- |
| 795 | 786 |
| 796 } // namespace blink | 787 } // namespace blink |
| OLD | NEW |