| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_IMPL_H_ | |
| 7 | |
| 8 #include "mojo/public/cpp/bindings/binding.h" | |
| 9 #include "third_party/WebKit/public/platform/modules/mediasession/media_session.
mojom.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 class RenderFrameHost; | |
| 14 | |
| 15 class MediaSessionServiceImpl : public blink::mojom::MediaSessionService { | |
| 16 public: | |
| 17 ~MediaSessionServiceImpl() override; | |
| 18 | |
| 19 static void Create(RenderFrameHost* render_frame_host, | |
| 20 blink::mojom::MediaSessionServiceRequest request); | |
| 21 | |
| 22 private: | |
| 23 explicit MediaSessionServiceImpl(RenderFrameHost* render_frame_host); | |
| 24 | |
| 25 void SetMetadata( | |
| 26 const base::Optional<content::MediaMetadata>& metadata) override; | |
| 27 | |
| 28 void Bind(blink::mojom::MediaSessionServiceRequest request); | |
| 29 | |
| 30 RenderFrameHost* render_frame_host_; | |
| 31 | |
| 32 // RAII binding of |this| to an MediaSession interface request. | |
| 33 // The binding is removed when binding_ is cleared or goes out of scope. | |
| 34 std::unique_ptr<mojo::Binding<blink::mojom::MediaSessionService>> binding_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(MediaSessionServiceImpl); | |
| 37 }; | |
| 38 | |
| 39 } // namespace content | |
| 40 | |
| 41 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_IMPL_H_ | |
| OLD | NEW |