chromium/chrome/browser/extensions/installed_loader.cc

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

#include "chrome/browser/extensions/installed_loader.h"

#include <stddef.h>

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

#include "base/files/file_path.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/corrupted_extension_reinstaller.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/load_error_reporter.h"
#include "chrome/browser/extensions/profile_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/chrome_manifest_url_handlers.h"
#include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/url_constants.h"
#include "extensions/browser/allowlist_state.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/permissions_manager.h"
#include "extensions/browser/pref_types.h"
#include "extensions/browser/ui_util.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_l10n_util.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/extension_urls.h"
#include "extensions/common/features/feature_developer_mode_only.h"
#include "extensions/common/file_util.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/permissions/api_permission.h"
#include "extensions/common/permissions/permissions_data.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "components/user_manager/user.h"
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

BrowserThread;

namespace extensions {

namespace {

// DO NOT REORDER. This enum is used in histograms.
enum class ManifestVersionPopulationSplit {};

// The following enumeration is used in histograms matching
// Extensions.ManifestReload*.
enum ManifestReloadReason {};

// Used in histogram Extensions.BackgroundPageType.
enum BackgroundPageType {};

// Used in histogram Extensions.ExternalItemState.
enum ExternalItemState {};

bool IsManifestCorrupt(const base::Value::Dict& manifest) {}

ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) {}

BackgroundPageType GetBackgroundPageType(const Extension* extension) {}

// Helper to record a single disable reason histogram value (see
// RecordDisableReasons below).
void RecordDisbleReasonHistogram(int reason) {}

// Records the disable reasons for a single extension grouped by
// disable_reason::DisableReason.
void RecordDisableReasons(int reasons) {}

// Returns the current access level for the given `extension`.
HostPermissionsAccess GetHostPermissionAccessLevelForExtension(
    const Extension& extension) {}

void LogHostPermissionsAccess(const Extension& extension,
                              bool should_record_incremented_metrics) {}

}  // namespace

InstalledLoader::InstalledLoader(ExtensionService* extension_service)
    :{}

InstalledLoader::~InstalledLoader() {}

void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) {}

void InstalledLoader::LoadAllExtensions() {}

void InstalledLoader::LoadAllExtensions(Profile* profile) {}

void InstalledLoader::RecordExtensionsMetricsForTesting() {}

void InstalledLoader::RecordExtensionsIncrementedMetricsForTesting(
    Profile* profile) {}

// TODO(crbug.com/40739895): Separate out Webstore/Offstore metrics.
void InstalledLoader::RecordExtensionsMetrics(Profile* profile,
                                              bool is_user_profile) {}

int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {}

}  // namespace extensions