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

Unified Diff: Source/core/html/shadow/MediaControls.cpp

Issue 182383006: Remove unfailable null checks in MediaControls (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/shadow/MediaControlsAndroid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/MediaControls.cpp
diff --git a/Source/core/html/shadow/MediaControls.cpp b/Source/core/html/shadow/MediaControls.cpp
index 3efe0c90efbed432ee4c8874b3108987b696421c..c9b9d3eb507194be58985544e7ebbe89c28f4d60 100644
--- a/Source/core/html/shadow/MediaControls.cpp
+++ b/Source/core/html/shadow/MediaControls.cpp
@@ -151,28 +151,18 @@ void MediaControls::setMediaController(MediaControllerInterface* controller)
return;
m_mediaController = controller;
- if (m_panel)
- m_panel->setMediaController(controller);
+ m_panel->setMediaController(controller);
if (m_textDisplayContainer)
m_textDisplayContainer->setMediaController(controller);
- if (m_playButton)
- m_playButton->setMediaController(controller);
- if (m_currentTimeDisplay)
- m_currentTimeDisplay->setMediaController(controller);
- if (m_timeline)
- m_timeline->setMediaController(controller);
- if (m_panelMuteButton)
- m_panelMuteButton->setMediaController(controller);
- if (m_volumeSlider)
- m_volumeSlider->setMediaController(controller);
- if (m_toggleClosedCaptionsButton)
- m_toggleClosedCaptionsButton->setMediaController(controller);
- if (m_fullScreenButton)
- m_fullScreenButton->setMediaController(controller);
- if (m_durationDisplay)
- m_durationDisplay->setMediaController(controller);
- if (m_enclosure)
- m_enclosure->setMediaController(controller);
+ m_playButton->setMediaController(controller);
+ m_currentTimeDisplay->setMediaController(controller);
+ m_timeline->setMediaController(controller);
+ m_panelMuteButton->setMediaController(controller);
+ m_volumeSlider->setMediaController(controller);
+ m_toggleClosedCaptionsButton->setMediaController(controller);
+ m_fullScreenButton->setMediaController(controller);
+ m_durationDisplay->setMediaController(controller);
+ m_enclosure->setMediaController(controller);
}
void MediaControls::reset()
@@ -194,23 +184,19 @@ void MediaControls::reset()
m_panelMuteButton->show();
- if (m_volumeSlider) {
- if (!m_mediaController->hasAudio())
- m_volumeSlider->hide();
- else {
- m_volumeSlider->show();
- m_volumeSlider->setVolume(m_mediaController->volume());
- }
+ if (!m_mediaController->hasAudio()) {
+ m_volumeSlider->hide();
+ } else {
+ m_volumeSlider->show();
+ m_volumeSlider->setVolume(m_mediaController->volume());
}
refreshClosedCaptionsButtonVisibility();
- if (m_fullScreenButton) {
- if (m_mediaController->hasVideo())
- m_fullScreenButton->show();
- else
- m_fullScreenButton->hide();
- }
+ if (m_mediaController->hasVideo())
+ m_fullScreenButton->show();
+ else
+ m_fullScreenButton->hide();
makeOpaque();
}
@@ -323,23 +309,18 @@ void MediaControls::changedMute()
void MediaControls::changedVolume()
{
- if (m_volumeSlider)
- m_volumeSlider->setVolume(m_mediaController->volume());
- if (m_panelMuteButton && m_panelMuteButton->renderer())
+ m_volumeSlider->setVolume(m_mediaController->volume());
+ if (m_panelMuteButton->renderer())
m_panelMuteButton->renderer()->repaint();
}
void MediaControls::changedClosedCaptionsVisibility()
{
- if (m_toggleClosedCaptionsButton)
- m_toggleClosedCaptionsButton->updateDisplayType();
+ m_toggleClosedCaptionsButton->updateDisplayType();
}
void MediaControls::refreshClosedCaptionsButtonVisibility()
{
- if (!m_toggleClosedCaptionsButton)
- return;
-
if (m_mediaController->hasClosedCaptions())
m_toggleClosedCaptionsButton->show();
else
@@ -456,8 +437,7 @@ void MediaControls::createTextTrackDisplay()
RefPtr<MediaControlTextTrackContainerElement> textDisplayContainer = MediaControlTextTrackContainerElement::create(document());
m_textDisplayContainer = textDisplayContainer.get();
- if (m_mediaController)
- m_textDisplayContainer->setMediaController(m_mediaController);
+ m_textDisplayContainer->setMediaController(m_mediaController);
insertTextTrackContainer(textDisplayContainer.release());
}
« no previous file with comments | « no previous file | Source/core/html/shadow/MediaControlsAndroid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698