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

#ifndef EXTENSIONS_COMMON_API_MANAGEMENT_H__
#define EXTENSIONS_COMMON_API_MANAGEMENT_H__

#include <stdint.h>

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

#include "base/values.h"
#include <string_view>


namespace extensions {
namespace api {
namespace management {

//
// Types
//

// Information about an icon belonging to an extension, app, or theme.
struct IconInfo {};

// These are all possible app launch types.
enum class LaunchType {};


const char* ToString(LaunchType as_enum);
LaunchType ParseLaunchType(std::string_view as_string);
std::u16string GetLaunchTypeParseError(std::string_view as_string);

// A reason the item is disabled.
enum class ExtensionDisabledReason {};


const char* ToString(ExtensionDisabledReason as_enum);
ExtensionDisabledReason ParseExtensionDisabledReason(std::string_view as_string);
std::u16string GetExtensionDisabledReasonParseError(std::string_view as_string);

// The type of this extension, app, or theme.
enum class ExtensionType {};


const char* ToString(ExtensionType as_enum);
ExtensionType ParseExtensionType(std::string_view as_string);
std::u16string GetExtensionTypeParseError(std::string_view as_string);

// How the extension was installed. One of<br><var>admin</var>: The extension
// was installed because of an administrative policy,<br><var>development</var>:
// The extension was loaded unpacked in developer mode,<br><var>normal</var>:
// The extension was installed normally via a .crx file,<br><var>sideload</var>:
// The extension was installed by other software on the
// machine,<br><var>other</var>: The extension was installed by other means.
enum class ExtensionInstallType {};


const char* ToString(ExtensionInstallType as_enum);
ExtensionInstallType ParseExtensionInstallType(std::string_view as_string);
std::u16string GetExtensionInstallTypeParseError(std::string_view as_string);

// Information about an installed extension, app, or theme.
struct ExtensionInfo {};

// Options for how to handle the extension's uninstallation.
struct UninstallOptions {};


//
// Functions
//

namespace GetAll {

namespace Results {

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

}  // namespace GetAll

namespace Get {

struct Params {};

namespace Results {

base::Value::List Create(const ExtensionInfo& result);
}  // namespace Results

}  // namespace Get

namespace GetSelf {

namespace Results {

base::Value::List Create(const ExtensionInfo& result);
}  // namespace Results

}  // namespace GetSelf

namespace GetPermissionWarningsById {

struct Params {};

namespace Results {

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

}  // namespace GetPermissionWarningsById

namespace GetPermissionWarningsByManifest {

struct Params {};

namespace Results {

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

}  // namespace GetPermissionWarningsByManifest

namespace SetEnabled {

struct Params {};

namespace Results {

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

}  // namespace SetEnabled

namespace Uninstall {

struct Params {};

namespace Results {

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

}  // namespace Uninstall

namespace UninstallSelf {

struct Params {};

namespace Results {

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

}  // namespace UninstallSelf

namespace LaunchApp {

struct Params {};

namespace Results {

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

}  // namespace LaunchApp

namespace CreateAppShortcut {

struct Params {};

namespace Results {

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

}  // namespace CreateAppShortcut

namespace SetLaunchType {

struct Params {};

namespace Results {

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

}  // namespace SetLaunchType

namespace GenerateAppForLink {

struct Params {};

namespace Results {

base::Value::List Create(const ExtensionInfo& result);
}  // namespace Results

}  // namespace GenerateAppForLink

namespace InstallReplacementWebApp {

namespace Results {

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

}  // namespace InstallReplacementWebApp

//
// Events
//

namespace OnInstalled {

extern const char kEventName[];  // "management.onInstalled"

base::Value::List Create(const ExtensionInfo& info);
}  // namespace OnInstalled

namespace OnUninstalled {

extern const char kEventName[];  // "management.onUninstalled"

// The id of the extension, app, or theme that was uninstalled.
base::Value::List Create(const std::string& id);
}  // namespace OnUninstalled

namespace OnEnabled {

extern const char kEventName[];  // "management.onEnabled"

base::Value::List Create(const ExtensionInfo& info);
}  // namespace OnEnabled

namespace OnDisabled {

extern const char kEventName[];  // "management.onDisabled"

base::Value::List Create(const ExtensionInfo& info);
}  // namespace OnDisabled

}  // namespace management
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_MANAGEMENT_H__