Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: Source/core/html/shadow/MediaControlElements.cpp

Issue 830183005: Re-enable the activation behavior of media elements (click to play/pause) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: simplify test Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698