Chromium Code Reviews| 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 #include "content/browser/media/session/media_session_service_impl.h" | 5 #include "content/browser/media/session/media_session_service_impl.h" |
| 6 | 6 |
| 7 #include "content/browser/media/session/media_metadata_sanitizer.h" | 7 #include "content/browser/media/session/media_metadata_sanitizer.h" |
| 8 #include "content/browser/media/session/media_session_impl.h" | 8 #include "content/browser/media/session/media_session_impl.h" |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 MediaSessionServiceImpl* impl = | 36 MediaSessionServiceImpl* impl = |
| 37 new MediaSessionServiceImpl(render_frame_host); | 37 new MediaSessionServiceImpl(render_frame_host); |
| 38 impl->Bind(std::move(request)); | 38 impl->Bind(std::move(request)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 RenderFrameHost* MediaSessionServiceImpl::GetRenderFrameHost() { | 41 RenderFrameHost* MediaSessionServiceImpl::GetRenderFrameHost() { |
| 42 return RenderFrameHost::FromID(render_frame_process_id_, | 42 return RenderFrameHost::FromID(render_frame_process_id_, |
| 43 render_frame_routing_id_); | 43 render_frame_routing_id_); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void MediaSessionServiceImpl::Reset() { | |
| 47 playback_state_ = blink::mojom::MediaSessionPlaybackState::NONE; | |
|
whywhat
2017/02/28 21:26:56
nit: I wonder if you should actually call SetPlayb
Zhiqiang Zhang (Slow)
2017/02/28 22:13:10
Done.
Also I think the actions should be cleared i
| |
| 48 metadata_ = base::nullopt; | |
| 49 actions_.clear(); | |
| 50 } | |
| 51 | |
| 46 void MediaSessionServiceImpl::SetClient( | 52 void MediaSessionServiceImpl::SetClient( |
| 47 blink::mojom::MediaSessionClientPtr client) { | 53 blink::mojom::MediaSessionClientPtr client) { |
| 48 client_ = std::move(client); | 54 client_ = std::move(client); |
| 49 } | 55 } |
| 50 | 56 |
| 51 void MediaSessionServiceImpl::SetPlaybackState( | 57 void MediaSessionServiceImpl::SetPlaybackState( |
| 52 blink::mojom::MediaSessionPlaybackState state) { | 58 blink::mojom::MediaSessionPlaybackState state) { |
| 53 playback_state_ = state; | 59 playback_state_ = state; |
| 54 MediaSessionImpl* session = GetMediaSession(); | 60 MediaSessionImpl* session = GetMediaSession(); |
| 55 if (session) | 61 if (session) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 return MediaSessionImpl::Get(contents); | 111 return MediaSessionImpl::Get(contents); |
| 106 } | 112 } |
| 107 | 113 |
| 108 void MediaSessionServiceImpl::Bind( | 114 void MediaSessionServiceImpl::Bind( |
| 109 blink::mojom::MediaSessionServiceRequest request) { | 115 blink::mojom::MediaSessionServiceRequest request) { |
| 110 binding_.reset(new mojo::Binding<blink::mojom::MediaSessionService>( | 116 binding_.reset(new mojo::Binding<blink::mojom::MediaSessionService>( |
| 111 this, std::move(request))); | 117 this, std::move(request))); |
| 112 } | 118 } |
| 113 | 119 |
| 114 } // namespace content | 120 } // namespace content |
| OLD | NEW |