chromium/out/Default/gen/chrome/common/extensions/api/desktop_capture.h

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

// GENERATED FROM THE API DEFINITION IN
//   chrome/common/extensions/api/desktop_capture.json
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef CHROME_COMMON_EXTENSIONS_API_DESKTOP_CAPTURE_H__
#define CHROME_COMMON_EXTENSIONS_API_DESKTOP_CAPTURE_H__

#include <stdint.h>

#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/values.h"
#include <string_view>
#include "chrome/common/extensions/api/tabs.h"


namespace extensions {
namespace api {
namespace desktop_capture {

//
// Types
//

// Enum used to define set of desktop media sources used in
// chooseDesktopMedia().
enum class DesktopCaptureSourceType {};


const char* ToString(DesktopCaptureSourceType as_enum);
DesktopCaptureSourceType ParseDesktopCaptureSourceType(std::string_view as_string);
std::u16string GetDesktopCaptureSourceTypeParseError(std::string_view as_string);

// Mirrors <a
// href="https://w3c.github.io/mediacapture-screen-share/#dom-systemaudiopreferenceenum">SystemAudioPreferenceEnum</a>.
enum class SystemAudioPreferenceEnum {};


const char* ToString(SystemAudioPreferenceEnum as_enum);
SystemAudioPreferenceEnum ParseSystemAudioPreferenceEnum(std::string_view as_string);
std::u16string GetSystemAudioPreferenceEnumParseError(std::string_view as_string);

// Mirrors <a
// href="https://w3c.github.io/mediacapture-screen-share/#dom-selfcapturepreferenceenum">SelfCapturePreferenceEnum</a>.
enum class SelfCapturePreferenceEnum {};


const char* ToString(SelfCapturePreferenceEnum as_enum);
SelfCapturePreferenceEnum ParseSelfCapturePreferenceEnum(std::string_view as_string);
std::u16string GetSelfCapturePreferenceEnumParseError(std::string_view as_string);


//
// Functions
//

namespace ChooseDesktopMedia {

struct Params {};

namespace Results {

// Contains properties that describe the stream.
struct Options {};


// An opaque string that can be passed to <code>getUserMedia()</code> API to
// generate media stream that corresponds to the source selected by the user. If
// user didn't select any source (i.e. canceled the prompt) then the callback is
// called with an empty <code>streamId</code>. The created <code>streamId</code>
// can be used only once and expires after a few seconds when it is not used.
// Contains properties that describe the stream.
base::Value::List Create(const std::string& stream_id, const Options& options);
}  // namespace Results

}  // namespace ChooseDesktopMedia

namespace CancelChooseDesktopMedia {

struct Params {};

}  // namespace CancelChooseDesktopMedia

}  // namespace desktop_capture
}  // namespace api
}  // namespace extensions

#endif  // CHROME_COMMON_EXTENSIONS_API_DESKTOP_CAPTURE_H__