#include "extensions/common/manifest_handlers/background_info.h"
#include <stddef.h>
#include <memory>
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/lazy_instance.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/file_util.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/permissions_parser.h"
#include "extensions/common/permissions/api_permission_set.h"
#include "extensions/common/switches.h"
#include "extensions/strings/grit/extensions_strings.h"
#include "ui/base/l10n/l10n_util.h"
APIPermissionID;
namespace extensions {
keys;
values;
errors;
namespace {
const char kBackground[] = …;
static base::LazyInstance<BackgroundInfo>::DestructorAtExit
g_empty_background_info = …;
const BackgroundInfo& GetBackgroundInfo(const Extension* extension) { … }
}
BackgroundInfo::BackgroundInfo()
: … { … }
BackgroundInfo::~BackgroundInfo() { … }
GURL BackgroundInfo::GetBackgroundURL(const Extension* extension) { … }
const std::string& BackgroundInfo::GetBackgroundServiceWorkerScript(
const Extension* extension) { … }
BackgroundServiceWorkerType BackgroundInfo::GetBackgroundServiceWorkerType(
const Extension* extension) { … }
const std::vector<std::string>& BackgroundInfo::GetBackgroundScripts(
const Extension* extension) { … }
bool BackgroundInfo::HasBackgroundPage(const Extension* extension) { … }
bool BackgroundInfo::HasPersistentBackgroundPage(const Extension* extension) { … }
bool BackgroundInfo::HasLazyBackgroundPage(const Extension* extension) { … }
bool BackgroundInfo::HasGeneratedBackgroundPage(const Extension* extension) { … }
bool BackgroundInfo::AllowJSAccess(const Extension* extension) { … }
bool BackgroundInfo::IsServiceWorkerBased(const Extension* extension) { … }
bool BackgroundInfo::Parse(const Extension* extension, std::u16string* error) { … }
bool BackgroundInfo::LoadBackgroundScripts(const Extension* extension,
const std::string& key,
std::u16string* error) { … }
bool BackgroundInfo::LoadBackgroundPage(const Extension* extension,
const std::string& key,
std::u16string* error) { … }
bool BackgroundInfo::LoadBackgroundServiceWorkerScript(
const Extension* extension,
std::u16string* error) { … }
bool BackgroundInfo::LoadBackgroundPage(const Extension* extension,
std::u16string* error) { … }
bool BackgroundInfo::LoadBackgroundPersistent(const Extension* extension,
std::u16string* error) { … }
bool BackgroundInfo::LoadAllowJSAccess(const Extension* extension,
std::u16string* error) { … }
BackgroundManifestHandler::BackgroundManifestHandler() { … }
BackgroundManifestHandler::~BackgroundManifestHandler() { … }
bool BackgroundManifestHandler::Parse(Extension* extension,
std::u16string* error) { … }
bool BackgroundManifestHandler::Validate(
const Extension* extension,
std::string* error,
std::vector<InstallWarning>* warnings) const { … }
bool BackgroundManifestHandler::AlwaysParseForType(Manifest::Type type) const { … }
base::span<const char* const> BackgroundManifestHandler::Keys() const { … }
}