chromium/extensions/browser/api/runtime/runtime_api.h

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

#ifndef EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_
#define EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_

#include <memory>
#include <optional>
#include <string>

#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "base/values.h"
#include "extensions/browser/api/runtime/runtime_api_delegate.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/events/lazy_event_dispatch_util.h"
#include "extensions/browser/extension_function.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_registry_observer.h"
#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_manager_observer.h"
#include "extensions/browser/update_observer.h"
#include "extensions/common/api/runtime.h"
#include "extensions/common/extension_id.h"

namespace base {
class Version;
}

namespace content {
class BrowserContext;
}

class PrefRegistrySimple;

namespace extensions {

namespace api::runtime {
struct PlatformInfo;
}

class Extension;
class ExtensionRegistry;

// Runtime API dispatches onStartup, onInstalled, and similar events to
// extensions. There is one instance shared between a browser context and
// its related incognito instance.
class RuntimeAPI : public BrowserContextKeyedAPI,
                   public ExtensionRegistryObserver,
                   public UpdateObserver,
                   public ProcessManagerObserver,
                   public LazyEventDispatchUtil::Observer {};

template <>
void BrowserContextKeyedAPIFactory<RuntimeAPI>::DeclareFactoryDependencies();

class RuntimeEventRouter {};

class RuntimeGetBackgroundPageFunction : public ExtensionFunction {};

class RuntimeOpenOptionsPageFunction : public ExtensionFunction {};

class RuntimeSetUninstallURLFunction : public ExtensionFunction {};

class RuntimeReloadFunction : public ExtensionFunction {};

class RuntimeRequestUpdateCheckFunction : public ExtensionFunction {};

class RuntimeRestartFunction : public ExtensionFunction {};

class RuntimeRestartAfterDelayFunction : public ExtensionFunction {};

class RuntimeGetPlatformInfoFunction : public ExtensionFunction {};

class RuntimeGetPackageDirectoryEntryFunction : public ExtensionFunction {};

class RuntimeGetContextsFunction : public ExtensionFunction {};

}  // namespace extensions

#endif  // EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_