1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49

content / public / browser / chromeos / multi_capture_service.h [blame]

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_BROWSER_CHROMEOS_MULTI_CAPTURE_SERVICE_H_
#define CONTENT_PUBLIC_BROWSER_CHROMEOS_MULTI_CAPTURE_SERVICE_H_

#include "content/common/content_export.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote_set.h"
#include "services/video_capture/public/mojom/multi_capture_service.mojom.h"

namespace content {

class CONTENT_EXPORT MultiCaptureService
    : public video_capture::mojom::MultiCaptureService {
 public:
  MultiCaptureService();
  MultiCaptureService(const MultiCaptureService&) = delete;
  MultiCaptureService& operator=(const MultiCaptureService&) = delete;
  ~MultiCaptureService() override;

  void BindMultiCaptureService(
      mojo::PendingReceiver<video_capture::mojom::MultiCaptureService>
          receiver);

  // video_capture::mojom::MultiCaptureService:
  void AddObserver(
      mojo::PendingRemote<video_capture::mojom::MultiCaptureServiceClient>
          observer) override;

  void NotifyMultiCaptureStarted(const std::string& label,
                                 const url::Origin& origin);
  void NotifyMultiCaptureStartedFromApp(const std::string& label,
                                        const std::string& app_id,
                                        const std::string& app_name);
  void NotifyMultiCaptureStopped(const std::string& label);

 private:
  mojo::ReceiverSet<video_capture::mojom::MultiCaptureService>
      multi_capture_service_receiver_set_;
  mojo::RemoteSet<video_capture::mojom::MultiCaptureServiceClient> observers_;
};

CONTENT_EXPORT MultiCaptureService& GetMultiCaptureService();

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_CHROMEOS_MULTI_CAPTURE_SERVICE_H_