chromium/out/Default/gen/chrome/common/extensions/api/scripting.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/scripting.idl
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef CHROME_COMMON_EXTENSIONS_API_SCRIPTING_H__
#define CHROME_COMMON_EXTENSIONS_API_SCRIPTING_H__

#include <stdint.h>

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

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


namespace extensions {
namespace api {
namespace scripting {

//
// Types
//

// The origin for a style change. See <a
// href="https://developer.mozilla.org/en-US/docs/Glossary/Style_origin">style
// origins</a> for more info.
enum class StyleOrigin {};


const char* ToString(StyleOrigin as_enum);
StyleOrigin ParseStyleOrigin(std::string_view as_string);
std::u16string GetStyleOriginParseError(std::string_view as_string);

// The JavaScript world for a script to execute within.
enum class ExecutionWorld {};


const char* ToString(ExecutionWorld as_enum);
ExecutionWorld ParseExecutionWorld(std::string_view as_string);
std::u16string GetExecutionWorldParseError(std::string_view as_string);

struct InjectionTarget {};

struct ScriptInjection {};

struct CSSInjection {};

struct InjectionResult {};

struct RegisteredContentScript {};

struct ContentScriptFilter {};


//
// Functions
//

namespace ExecuteScript {

struct Params {};

namespace Results {

base::Value::List Create(const std::vector<InjectionResult>& results);
}  // namespace Results

}  // namespace ExecuteScript

namespace InsertCSS {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace InsertCSS

namespace RemoveCSS {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace RemoveCSS

namespace RegisterContentScripts {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace RegisterContentScripts

namespace GetRegisteredContentScripts {

struct Params {};

namespace Results {

base::Value::List Create(const std::vector<RegisteredContentScript>& scripts);
}  // namespace Results

}  // namespace GetRegisteredContentScripts

namespace UnregisterContentScripts {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace UnregisterContentScripts

namespace UpdateContentScripts {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace UpdateContentScripts

}  // namespace scripting
}  // namespace api
}  // namespace extensions

#endif  // CHROME_COMMON_EXTENSIONS_API_SCRIPTING_H__