• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 
5 #ifndef CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_IMPL_H_
6 #define CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_IMPL_H_
7 #pragma once
8 
9 #include "include/cef_media_router.h"
10 
11 #include "components/media_router/common/media_source.h"
12 
13 // Implementation of the CefMediaSource interface. May be created on any thread.
14 class CefMediaSourceImpl : public CefMediaSource {
15  public:
16   explicit CefMediaSourceImpl(const media_router::MediaSource::Id& source_id);
17   explicit CefMediaSourceImpl(const GURL& presentation_url);
18 
19   CefMediaSourceImpl(const CefMediaSourceImpl&) = delete;
20   CefMediaSourceImpl& operator=(const CefMediaSourceImpl&) = delete;
21 
22   // CefMediaSource methods.
23   CefString GetId() override;
24   bool IsCastSource() override;
25   bool IsDialSource() override;
26 
source()27   const media_router::MediaSource& source() const { return source_; }
28 
29  private:
30   // Read-only after creation.
31   const media_router::MediaSource source_;
32 
33   IMPLEMENT_REFCOUNTING(CefMediaSourceImpl);
34 };
35 
36 #endif  // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_IMPL_H_
37