Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
| diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
| index ab6d1484d6c2745d87b7cf773b5775d974c2d41b..4dafc7a627b8f385d7791687cfd92f8a73f50d97 100644 |
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
| @@ -414,8 +414,7 @@ void MediaControls::updateVolume() |
| { |
| m_muteButton->updateDisplayType(); |
| // Invalidate the mute button because it paints differently according to volume. |
| - if (LayoutObject* layoutObject = m_muteButton->layoutObject()) |
| - layoutObject->setShouldDoFullPaintInvalidation(); |
| + repaint(m_muteButton); |
|
philipj_slow
2015/10/28 15:14:02
Maybe call it invalidate() to match the comment? I
liberato (no reviews please)
2015/10/29 16:10:26
Done. ... but it really does toggleVariousBits().
|
| if (mediaElement().muted()) |
| m_volumeSlider->setVolume(0); |
| @@ -441,8 +440,7 @@ void MediaControls::updateVolume() |
| } |
| // Invalidate the volume slider because it paints differently according to volume. |
| - if (LayoutObject* layoutObject = m_volumeSlider->layoutObject()) |
| - layoutObject->setShouldDoFullPaintInvalidation(); |
| + repaint(m_volumeSlider); |
| } |
| void MediaControls::changedClosedCaptionsVisibility() |
| @@ -708,6 +706,25 @@ void MediaControls::setAllowHiddenVolumeControls(bool allow) |
| updateVolume(); |
| } |
| +void MediaControls::repaint(Element* element) |
| +{ |
| + if (!element) |
| + return; |
| + |
| + if (LayoutObject* layoutObject = element->layoutObject()) |
| + layoutObject->setShouldDoFullPaintInvalidation(); |
| +} |
| + |
| +void MediaControls::networkStateChanged() |
| +{ |
| + repaint(m_playButton); |
| + repaint(m_overlayPlayButton); |
| + repaint(m_muteButton); |
| + repaint(m_fullScreenButton); |
| + repaint(m_timeline); |
| + repaint(m_volumeSlider); |
| +} |
| + |
| DEFINE_TRACE(MediaControls) |
| { |
| visitor->trace(m_mediaElement); |