Chromium Code Reviews| Index: media/remoting/remoting_renderer_controller.h |
| diff --git a/media/remoting/remoting_renderer_controller.h b/media/remoting/remoting_renderer_controller.h |
| index 9c98af12b555441c1ade86ff34291b321c7a8076..5a581573d75c04b92f0138475fe13843bb457437 100644 |
| --- a/media/remoting/remoting_renderer_controller.h |
| +++ b/media/remoting/remoting_renderer_controller.h |
| @@ -8,6 +8,7 @@ |
| #include "base/callback.h" |
| #include "base/memory/weak_ptr.h" |
| #include "media/base/media_observer.h" |
| +#include "media/remoting/remoting_interstitial_ui.h" |
| #include "media/remoting/remoting_source_impl.h" |
| namespace media { |
| @@ -40,6 +41,23 @@ class RemotingRendererController final : public RemotingSourceImpl::Client, |
| void SetSwitchRendererCallback(const base::Closure& cb); |
| + using ShowInterstitialCallback = base::Callback< |
| + void(const SkBitmap&, const gfx::Size&, RemotingInterstitialType type)>; |
| + // Called by RemoteRendererImpl constructor to set the callback to draw and |
| + // show remoting interstial. |
| + void SetShowInterstitialCallback(const ShowInterstitialCallback& cb); |
| + |
| + // Called when any of the following happens: |
| + // 1. SetShowInterstitialCallback() is called (RemoteRendererImpl is |
| + // constructed); |
| + // 2. The remoting session is shut down (to update the status message in the |
| + // interstitial). |
| + // 3. The size of the canvas is changed (to update the background image and |
| + // the position of the status message). |
| + // TODO(xjz): Call this when poster url is set/changed. Download poster image |
| + // when available, and draw interstitial on it. |
| + void UpdateInterstitial(); |
|
miu
2016/12/20 00:16:17
Seems like this should be a private method.
xjz
2016/12/20 19:32:29
Done.
|
| + |
| base::WeakPtr<RemotingRendererController> GetWeakPtr() { |
| return weak_factory_.GetWeakPtr(); |
| } |
| @@ -64,11 +82,6 @@ class RemotingRendererController final : public RemotingSourceImpl::Client, |
| base::WeakPtr<remoting::RpcBroker> GetRpcBroker() const; |
| - PipelineMetadata pipeline_metadata() const { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - return pipeline_metadata_; |
| - } |
| - |
| private: |
| bool has_audio() const { |
| return pipeline_metadata_.has_audio && |
| @@ -99,10 +112,6 @@ class RemotingRendererController final : public RemotingSourceImpl::Client, |
| // Indicates whether audio or video is encrypted. |
| bool is_encrypted_ = false; |
| - // Current audio/video config. |
| - VideoDecoderConfig video_decoder_config_; |
| - AudioDecoderConfig audio_decoder_config_; |
| - |
| // The callback to switch the media renderer. |
| base::Closure switch_renderer_cb_; |
| @@ -116,6 +125,11 @@ class RemotingRendererController final : public RemotingSourceImpl::Client, |
| PipelineMetadata pipeline_metadata_; |
| + // The callback to show remoting interstitial. It is set when entering the |
| + // remoting mode (RemotingRendererImpl is constructed) by calling |
| + // SetShowInterstitialCallback(), and is reset when leaving the remoting mode. |
| + ShowInterstitialCallback show_interstitial_cb_; |
| + |
| base::WeakPtrFactory<RemotingRendererController> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(RemotingRendererController); |