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

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

Issue 2589873002: Media Controls: use loadedmetadata and error events. (Closed)
Patch Set: Created 3 years, 12 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
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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 741
742 void MediaControls::onTextTracksAddedOrRemoved() { 742 void MediaControls::onTextTracksAddedOrRemoved() {
743 m_toggleClosedCaptionsButton->setIsWanted(mediaElement().hasClosedCaptions()); 743 m_toggleClosedCaptionsButton->setIsWanted(mediaElement().hasClosedCaptions());
744 BatchedControlUpdate batch(this); 744 BatchedControlUpdate batch(this);
745 } 745 }
746 746
747 void MediaControls::onTextTracksChanged() { 747 void MediaControls::onTextTracksChanged() {
748 m_toggleClosedCaptionsButton->updateDisplayType(); 748 m_toggleClosedCaptionsButton->updateDisplayType();
749 } 749 }
750 750
751 void MediaControls::onError() {
752 // TODO(mlamouri): we should only change the aspects of the control that need
753 // to be changed.
754 reset();
755 }
756
757 void MediaControls::onLoadedMetadata() {
758 // TODO(mlamouri): we should only change the aspects of the control that need
759 // to be changed.
760 reset();
761 }
762
751 void MediaControls::notifyPanelWidthChanged(const LayoutUnit& newWidth) { 763 void MediaControls::notifyPanelWidthChanged(const LayoutUnit& newWidth) {
752 // Don't bother to do any work if this matches the most recent panel 764 // Don't bother to do any work if this matches the most recent panel
753 // width, since we're called after layout. 765 // width, since we're called after layout.
754 // Note that this code permits a bad frame on resize, since it is 766 // Note that this code permits a bad frame on resize, since it is
755 // run after the relayout / paint happens. It would be great to improve 767 // run after the relayout / paint happens. It would be great to improve
756 // this, but it would be even greater to move this code entirely to 768 // this, but it would be even greater to move this code entirely to
757 // JS and fix it there. 769 // JS and fix it there.
758 m_panelWidth = newWidth.toInt(); 770 m_panelWidth = newWidth.toInt();
759 771
760 // Adjust for effective zoom. 772 // Adjust for effective zoom.
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 visitor->trace(m_overflowList); 951 visitor->trace(m_overflowList);
940 visitor->trace(m_castButton); 952 visitor->trace(m_castButton);
941 visitor->trace(m_overlayCastButton); 953 visitor->trace(m_overlayCastButton);
942 visitor->trace(m_mediaEventListener); 954 visitor->trace(m_mediaEventListener);
943 visitor->trace(m_windowEventListener); 955 visitor->trace(m_windowEventListener);
944 visitor->trace(m_orientationLockDelegate); 956 visitor->trace(m_orientationLockDelegate);
945 HTMLDivElement::trace(visitor); 957 HTMLDivElement::trace(visitor);
946 } 958 }
947 959
948 } // namespace blink 960 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698