| Index: media/remoting/remoting_renderer_controller.cc
|
| diff --git a/media/remoting/remoting_renderer_controller.cc b/media/remoting/remoting_renderer_controller.cc
|
| index 5f0d37eacdbc7a5939d49d5b0941e7077d07da8f..90c39cc429081fcdd5786a002b030582c34b5d56 100644
|
| --- a/media/remoting/remoting_renderer_controller.cc
|
| +++ b/media/remoting/remoting_renderer_controller.cc
|
| @@ -73,6 +73,15 @@ void RemotingRendererController::OnSetCdm(CdmContext* cdm_context) {
|
| UpdateAndMaybeSwitch();
|
| }
|
|
|
| +void RemotingRendererController::OnSetPoster(const GURL& poster_url) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| +
|
| + if (poster_url != poster_url_) {
|
| + poster_url_ = poster_url;
|
| + UpdateAndMaybeShowInterstitial();
|
| + }
|
| +}
|
| +
|
| void RemotingRendererController::SetSwitchRendererCallback(
|
| const base::Closure& cb) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| @@ -243,4 +252,35 @@ void RemotingRendererController::UpdateAndMaybeSwitch() {
|
| }
|
| }
|
|
|
| +void RemotingRendererController::SetDownloadPosterCallback(
|
| + const DownloadPosterCallback& cb) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + DCHECK(download_poster_cb_.is_null());
|
| + download_poster_cb_ = cb;
|
| +}
|
| +
|
| +void RemotingRendererController::UpdateAndMaybeShowInterstitial() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + if (pipeline_metadata_.natural_size.IsEmpty())
|
| + return;
|
| +
|
| + DCHECK(remote_rendering_started_);
|
| + if (poster_url_.is_empty() || download_poster_cb_.is_null()) {
|
| + // TODO(xjz): Draw interstitial on a black image and show it.
|
| + // https://codereview.chromium.org/2566223005/
|
| + } else {
|
| + download_poster_cb_.Run(
|
| + poster_url_,
|
| + base::Bind(&RemotingRendererController::PosterImageDownloaded,
|
| + weak_factory_.GetWeakPtr()));
|
| + }
|
| +}
|
| +
|
| +void RemotingRendererController::PosterImageDownloaded(const SkBitmap& image) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + DCHECK(remote_rendering_started_);
|
| + // TODO(xjz): Draw interstitial on |image| and show it.
|
| + // https://codereview.chromium.org/2566223005/
|
| +}
|
| +
|
| } // namespace media
|
|
|