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

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

Issue 2563853003: [MediaControls] Listen to durationchange instead of letting HTML call methods of MediaControls (Closed)
Patch Set: addressed nits from mlamouri@ Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2011, 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 // become transparent in that case. 698 // become transparent in that case.
699 if (mediaElement().paused()) { 699 if (mediaElement().paused()) {
700 makeOpaque(); 700 makeOpaque();
701 return; 701 return;
702 } 702 }
703 703
704 if (isVisible() && shouldHideMediaControls()) 704 if (isVisible() && shouldHideMediaControls())
705 makeTransparent(); 705 makeTransparent();
706 } 706 }
707 707
708 void MediaControls::onDurationChange() {
709 m_timeline->setDuration(mediaElement().duration());
710 updateCurrentTimeDisplay();
711 }
712
708 void MediaControls::onPlay() { 713 void MediaControls::onPlay() {
709 updatePlayState(); 714 updatePlayState();
710 m_timeline->setPosition(mediaElement().currentTime()); 715 m_timeline->setPosition(mediaElement().currentTime());
711 updateCurrentTimeDisplay(); 716 updateCurrentTimeDisplay();
712 717
713 startHideMediaControlsTimer(); 718 startHideMediaControlsTimer();
714 } 719 }
715 720
716 void MediaControls::onPause() { 721 void MediaControls::onPause() {
717 updatePlayState(); 722 updatePlayState();
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 visitor->trace(m_overflowMenu); 926 visitor->trace(m_overflowMenu);
922 visitor->trace(m_overflowList); 927 visitor->trace(m_overflowList);
923 visitor->trace(m_castButton); 928 visitor->trace(m_castButton);
924 visitor->trace(m_overlayCastButton); 929 visitor->trace(m_overlayCastButton);
925 visitor->trace(m_mediaEventListener); 930 visitor->trace(m_mediaEventListener);
926 visitor->trace(m_windowEventListener); 931 visitor->trace(m_windowEventListener);
927 HTMLDivElement::trace(visitor); 932 HTMLDivElement::trace(visitor);
928 } 933 }
929 934
930 } // namespace blink 935 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698