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

#ifndef EXTENSIONS_COMMON_API_RUNTIME_H__
#define EXTENSIONS_COMMON_API_RUNTIME_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 runtime {

//
// Properties
//

//
// Types
//

// The operating system Chrome is running on.
enum class PlatformOs {};


const char* ToString(PlatformOs as_enum);
PlatformOs ParsePlatformOs(std::string_view as_string);
std::u16string GetPlatformOsParseError(std::string_view as_string);

// The machine's processor architecture.
enum class PlatformArch {};


const char* ToString(PlatformArch as_enum);
PlatformArch ParsePlatformArch(std::string_view as_string);
std::u16string GetPlatformArchParseError(std::string_view as_string);

// The native client architecture. This may be different from arch on some
// platforms.
enum class PlatformNaclArch {};


const char* ToString(PlatformNaclArch as_enum);
PlatformNaclArch ParsePlatformNaclArch(std::string_view as_string);
std::u16string GetPlatformNaclArchParseError(std::string_view as_string);

// An object containing information about the current platform.
struct PlatformInfo {};

// Result of the update check.
enum class RequestUpdateCheckStatus {};


const char* ToString(RequestUpdateCheckStatus as_enum);
RequestUpdateCheckStatus ParseRequestUpdateCheckStatus(std::string_view as_string);
std::u16string GetRequestUpdateCheckStatusParseError(std::string_view as_string);

// The reason that this event is being dispatched.
enum class OnInstalledReason {};


const char* ToString(OnInstalledReason as_enum);
OnInstalledReason ParseOnInstalledReason(std::string_view as_string);
std::u16string GetOnInstalledReasonParseError(std::string_view as_string);

// The reason that the event is being dispatched. 'app_update' is used when the
// restart is needed because the application is updated to a newer version.
// 'os_update' is used when the restart is needed because the browser/OS is
// updated to a newer version. 'periodic' is used when the system runs for more
// than the permitted uptime set in the enterprise policy.
enum class OnRestartRequiredReason {};


const char* ToString(OnRestartRequiredReason as_enum);
OnRestartRequiredReason ParseOnRestartRequiredReason(std::string_view as_string);
std::u16string GetOnRestartRequiredReasonParseError(std::string_view as_string);

enum class ContextType {};


const char* ToString(ContextType as_enum);
ContextType ParseContextType(std::string_view as_string);
std::u16string GetContextTypeParseError(std::string_view as_string);

// A context hosting extension content.
struct ExtensionContext {};

// A filter to match against certain extension contexts. Matching contexts must
// match all specified filters; any filter that is not specified matches all
// available contexts. Thus, a filter of `{}` will match all available contexts.
struct ContextFilter {};


//
// Functions
//

namespace GetBackgroundPage {

namespace Results {

// The JavaScript 'window' object for the background page.
struct BackgroundPage {};


// The JavaScript 'window' object for the background page.
base::Value::List Create(const BackgroundPage& background_page);
}  // namespace Results

}  // namespace GetBackgroundPage

namespace OpenOptionsPage {

namespace Results {

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

}  // namespace OpenOptionsPage

namespace SetUninstallURL {

struct Params {};

namespace Results {

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

}  // namespace SetUninstallURL

namespace Reload {

}  // namespace Reload

namespace RequestUpdateCheck {

namespace Results {

// RequestUpdateCheckResult object that holds the status of the update check and
// any details of the result if there is an update available
struct Result {};


// RequestUpdateCheckResult object that holds the status of the update check and
// any details of the result if there is an update available
base::Value::List Create(const Result& result);
}  // namespace Results

}  // namespace RequestUpdateCheck

namespace Restart {

}  // namespace Restart

namespace RestartAfterDelay {

struct Params {};

namespace Results {

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

}  // namespace RestartAfterDelay

namespace GetPlatformInfo {

namespace Results {

base::Value::List Create(const PlatformInfo& platform_info);
}  // namespace Results

}  // namespace GetPlatformInfo

namespace GetPackageDirectoryEntry {

namespace Results {

struct DirectoryEntry {};


base::Value::List Create(const DirectoryEntry& directory_entry);
}  // namespace Results

}  // namespace GetPackageDirectoryEntry

namespace GetContexts {

struct Params {};

namespace Results {

// The matching contexts, if any.
base::Value::List Create(const std::vector<ExtensionContext>& contexts);
}  // namespace Results

}  // namespace GetContexts

//
// Events
//

namespace OnStartup {

extern const char kEventName[];  // "runtime.onStartup"

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

namespace OnInstalled {

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

struct Details {};


base::Value::List Create(const Details& details);
}  // namespace OnInstalled

namespace OnSuspend {

extern const char kEventName[];  // "runtime.onSuspend"

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

namespace OnSuspendCanceled {

extern const char kEventName[];  // "runtime.onSuspendCanceled"

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

namespace OnUpdateAvailable {

extern const char kEventName[];  // "runtime.onUpdateAvailable"

// The manifest details of the available update.
struct Details {};


// The manifest details of the available update.
base::Value::List Create(const Details& details);
}  // namespace OnUpdateAvailable

namespace OnBrowserUpdateAvailable {

extern const char kEventName[];  // "runtime.onBrowserUpdateAvailable"

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

namespace OnRestartRequired {

extern const char kEventName[];  // "runtime.onRestartRequired"

// The reason that the event is being dispatched.
base::Value::List Create(const OnRestartRequiredReason& reason);
}  // namespace OnRestartRequired

}  // namespace runtime
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_RUNTIME_H__