| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ | 5 #ifndef MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ |
| 6 #define MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ | 6 #define MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "media/base/media_observer.h" | 10 #include "media/base/media_observer.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 scoped_refptr<RemotingSourceImpl> remoting_source); | 28 scoped_refptr<RemotingSourceImpl> remoting_source); |
| 29 ~RemotingRendererController() override; | 29 ~RemotingRendererController() override; |
| 30 | 30 |
| 31 // RemotingSourceImpl::Client implemenations. | 31 // RemotingSourceImpl::Client implemenations. |
| 32 void OnStarted(bool success) override; | 32 void OnStarted(bool success) override; |
| 33 void OnSessionStateChanged() override; | 33 void OnSessionStateChanged() override; |
| 34 | 34 |
| 35 // MediaObserver implementations. | 35 // MediaObserver implementations. |
| 36 void OnEnteredFullscreen() override; | 36 void OnEnteredFullscreen() override; |
| 37 void OnExitedFullscreen() override; | 37 void OnExitedFullscreen() override; |
| 38 void OnBecameDominantVisibleContent(bool is_dominant) override; |
| 38 void OnSetCdm(CdmContext* cdm_context) override; | 39 void OnSetCdm(CdmContext* cdm_context) override; |
| 39 void OnMetadataChanged(const PipelineMetadata& metadata) override; | 40 void OnMetadataChanged(const PipelineMetadata& metadata) override; |
| 40 void OnRemotePlaybackDisabled(bool disabled) override; | 41 void OnRemotePlaybackDisabled(bool disabled) override; |
| 41 | 42 |
| 42 void SetSwitchRendererCallback(const base::Closure& cb); | 43 void SetSwitchRendererCallback(const base::Closure& cb); |
| 43 | 44 |
| 44 base::WeakPtr<RemotingRendererController> GetWeakPtr() { | 45 base::WeakPtr<RemotingRendererController> GetWeakPtr() { |
| 45 return weak_factory_.GetWeakPtr(); | 46 return weak_factory_.GetWeakPtr(); |
| 46 } | 47 } |
| 47 | 48 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 107 |
| 107 // Indicates whether remote playback is currently disabled. This starts out as | 108 // Indicates whether remote playback is currently disabled. This starts out as |
| 108 // true, and should be updated at least once via a call to | 109 // true, and should be updated at least once via a call to |
| 109 // OnRemotePlaybackDisabled() at some point in the future. A web page | 110 // OnRemotePlaybackDisabled() at some point in the future. A web page |
| 110 // typically sets/removes the disableRemotePlayback attribute on a | 111 // typically sets/removes the disableRemotePlayback attribute on a |
| 111 // HTMLMediaElement to disable/enable remoting of its content. Please see the | 112 // HTMLMediaElement to disable/enable remoting of its content. Please see the |
| 112 // Remote Playback API spec for more details: | 113 // Remote Playback API spec for more details: |
| 113 // https://w3c.github.io/remote-playback | 114 // https://w3c.github.io/remote-playback |
| 114 bool is_remote_playback_disabled_ = true; | 115 bool is_remote_playback_disabled_ = true; |
| 115 | 116 |
| 117 // Indicates whether video is the dominant visible content in the tab. |
| 118 bool is_dominant_content_ = false; |
| 119 |
| 116 // The callback to switch the media renderer. | 120 // The callback to switch the media renderer. |
| 117 base::Closure switch_renderer_cb_; | 121 base::Closure switch_renderer_cb_; |
| 118 | 122 |
| 119 // This is initially the RemotingSourceImpl passed to the ctor, and might be | 123 // This is initially the RemotingSourceImpl passed to the ctor, and might be |
| 120 // replaced with a different instance later if OnSetCdm() is called. | 124 // replaced with a different instance later if OnSetCdm() is called. |
| 121 scoped_refptr<RemotingSourceImpl> remoting_source_; | 125 scoped_refptr<RemotingSourceImpl> remoting_source_; |
| 122 | 126 |
| 123 // This is used to check all the methods are called on the current thread in | 127 // This is used to check all the methods are called on the current thread in |
| 124 // debug builds. | 128 // debug builds. |
| 125 base::ThreadChecker thread_checker_; | 129 base::ThreadChecker thread_checker_; |
| 126 | 130 |
| 127 PipelineMetadata pipeline_metadata_; | 131 PipelineMetadata pipeline_metadata_; |
| 128 | 132 |
| 129 base::WeakPtrFactory<RemotingRendererController> weak_factory_; | 133 base::WeakPtrFactory<RemotingRendererController> weak_factory_; |
| 130 | 134 |
| 131 DISALLOW_COPY_AND_ASSIGN(RemotingRendererController); | 135 DISALLOW_COPY_AND_ASSIGN(RemotingRendererController); |
| 132 }; | 136 }; |
| 133 | 137 |
| 134 } // namespace media | 138 } // namespace media |
| 135 | 139 |
| 136 #endif // MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ | 140 #endif // MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ |
| OLD | NEW |