diff options
author | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-26 19:11:06 +0000 |
---|---|---|
committer | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-26 19:11:06 +0000 |
commit | c5c807271f80989dab31adf321238f495d33a612 (patch) | |
tree | 6aa20cc5dc973b051efbf82d140822d337840c02 /webkit/glue/webmediaplayer_impl.cc | |
parent | e6443e70aad76bdec71648371201f36f64b03b8d (diff) | |
download | chromium_src-c5c807271f80989dab31adf321238f495d33a612.zip chromium_src-c5c807271f80989dab31adf321238f495d33a612.tar.gz chromium_src-c5c807271f80989dab31adf321238f495d33a612.tar.bz2 |
Fixing bug where paused resource loading needs final repaint
Adds logic in WebMediaPlayerImpl to trigger one last repaint before
going idle when the media is fully loaded.
BUG=49567
TEST=media_unittests
TBR=hclam
Review URL: http://codereview.chromium.org/3033027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r-- | webkit/glue/webmediaplayer_impl.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index 51d67ab..f5b87cf 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -657,10 +657,16 @@ void WebMediaPlayerImpl::OnPipelineError() { void WebMediaPlayerImpl::OnNetworkEvent() { DCHECK(MessageLoop::current() == main_loop_); if (pipeline_->GetError() == media::PIPELINE_OK) { - if (pipeline_->IsNetworkActive()) + if (pipeline_->IsNetworkActive()) { SetNetworkState(WebKit::WebMediaPlayer::Loading); - else + } else { + // If we are inactive because we just finished receiving all the data, + // do one final repaint to show final progress. + if (bytesLoaded() == totalBytes() && + network_state_ != WebKit::WebMediaPlayer::Idle) + Repaint(); SetNetworkState(WebKit::WebMediaPlayer::Idle); + } } } |