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

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

Issue 1827573004: Allow play/pause on default controls to clear media errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 RefPtrWillBeRawPtr<MediaControlPlayButtonElement> button = adoptRefWillBeNoo p(new MediaControlPlayButtonElement(mediaControls)); 277 RefPtrWillBeRawPtr<MediaControlPlayButtonElement> button = adoptRefWillBeNoo p(new MediaControlPlayButtonElement(mediaControls));
278 button->ensureUserAgentShadowRoot(); 278 button->ensureUserAgentShadowRoot();
279 button->setType(InputTypeNames::button); 279 button->setType(InputTypeNames::button);
280 button->setShadowPseudoId(AtomicString("-webkit-media-controls-play-button", AtomicString::ConstructFromLiteral)); 280 button->setShadowPseudoId(AtomicString("-webkit-media-controls-play-button", AtomicString::ConstructFromLiteral));
281 return button.release(); 281 return button.release();
282 } 282 }
283 283
284 void MediaControlPlayButtonElement::defaultEventHandler(Event* event) 284 void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
285 { 285 {
286 if (event->type() == EventTypeNames::click) { 286 if (event->type() == EventTypeNames::click) {
287 if (mediaElement().error())
288 mediaElement().load();
philipj_slow 2016/03/24 07:00:05 I think an error doesn't actually set paused to tr
DaleCurtis 2016/03/24 18:50:16 Ah, I thought that was a bug, I was going to hunt
289
287 mediaElement().togglePlayState(); 290 mediaElement().togglePlayState();
288 updateDisplayType(); 291 updateDisplayType();
289 event->setDefaultHandled(); 292 event->setDefaultHandled();
290 } 293 }
291 HTMLInputElement::defaultEventHandler(event); 294 HTMLInputElement::defaultEventHandler(event);
292 } 295 }
293 296
294 void MediaControlPlayButtonElement::updateDisplayType() 297 void MediaControlPlayButtonElement::updateDisplayType()
295 { 298 {
296 setDisplayType(mediaElement().paused() ? MediaPlayButton : MediaPauseButton) ; 299 setDisplayType(mediaElement().paused() ? MediaPlayButton : MediaPauseButton) ;
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 } 652 }
650 653
651 PassRefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurren tTimeDisplayElement::create(MediaControls& mediaControls) 654 PassRefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurren tTimeDisplayElement::create(MediaControls& mediaControls)
652 { 655 {
653 RefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> element = adoptRef WillBeNoop(new MediaControlCurrentTimeDisplayElement(mediaControls)); 656 RefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> element = adoptRef WillBeNoop(new MediaControlCurrentTimeDisplayElement(mediaControls));
654 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time -display", AtomicString::ConstructFromLiteral)); 657 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time -display", AtomicString::ConstructFromLiteral));
655 return element.release(); 658 return element.release();
656 } 659 }
657 660
658 } // namespace blink 661 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698