| 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 |
| 314 void MediaControlOverlayPlayButtonElement::updateDisplayType() | 323 void MediaControlOverlayPlayButtonElement::updateDisplayType() |
| 315 { | 324 { |
| 316 if (mediaElement().shouldShowControls() && mediaElement().togglePlayStateWil
lPlay()) | 325 if (mediaElement().shouldShowControls() && mediaElement().togglePlayStateWil
lPlay()) |
| 317 show(); | 326 show(); |
| 318 else | 327 else |
| 319 hide(); | 328 hide(); |
| 320 } | 329 } |
| 321 | 330 |
| 322 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const | 331 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const |
| 323 { | 332 { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 float fontSize = smallestDimension * 0.05f; | 787 float fontSize = smallestDimension * 0.05f; |
| 779 if (fontSize != m_fontSize) { | 788 if (fontSize != m_fontSize) { |
| 780 m_fontSize = fontSize; | 789 m_fontSize = fontSize; |
| 781 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); | 790 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); |
| 782 } | 791 } |
| 783 } | 792 } |
| 784 | 793 |
| 785 // ---------------------------- | 794 // ---------------------------- |
| 786 | 795 |
| 787 } // namespace blink | 796 } // namespace blink |
| OLD | NEW |