chromium/chrome/browser/supervised_user/supervised_user_extensions_manager.cc

// Copyright 2023 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/supervised_user/supervised_user_extensions_manager.h"

#include <string>

#include "base/containers/contains.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/supervised_user/supervised_user_browser_utils.h"
#include "chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/supervised_user/core/browser/supervised_user_preferences.h"
#include "components/supervised_user/core/browser/supervised_user_service.h"
#include "components/supervised_user/core/common/features.h"
#include "components/supervised_user/core/common/pref_names.h"
#include "components/supervised_user/core/common/supervised_user_constants.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/pref_names.h"
#include "ui/base/l10n/l10n_util.h"

namespace extensions {

namespace {

// These extensions are allowed for supervised users for internal development
// purposes.
constexpr char const* kAllowlistExtensionIds[] =;

// Returns the set of extensions that are missing parent approval.
base::Value::Dict GetExtensionsMissingApproval(const PrefService& user_prefs) {}
}  // namespace

SupervisedUserExtensionsManager::SupervisedUserExtensionsManager(
    content::BrowserContext* context)
    :{}

SupervisedUserExtensionsManager::~SupervisedUserExtensionsManager() {}

void SupervisedUserExtensionsManager::UpdateManagementPolicyRegistration() {}

void SupervisedUserExtensionsManager::AddExtensionApproval(
    const extensions::Extension& extension) {}

void SupervisedUserExtensionsManager::MaybeRecordPermissionsIncreaseMetrics(
    const extensions::Extension& extension) {}

void SupervisedUserExtensionsManager::RemoveExtensionApproval(
    const extensions::Extension& extension) {}

bool SupervisedUserExtensionsManager::IsExtensionAllowed(
    const extensions::Extension& extension) const {}

bool SupervisedUserExtensionsManager::CanInstallExtensions() const {}

void SupervisedUserExtensionsManager::RecordExtensionEnablementUmaMetrics(
    bool enabled) const {}

std::string SupervisedUserExtensionsManager::GetDebugPolicyProviderName()
    const {}

bool SupervisedUserExtensionsManager::UserMayLoad(
    const extensions::Extension* extension,
    std::u16string* error) const {}

bool SupervisedUserExtensionsManager::MustRemainDisabled(
    const extensions::Extension* extension,
    extensions::disable_reason::DisableReason* reason,
    std::u16string* error) const {}

void SupervisedUserExtensionsManager::OnExtensionInstalled(
    content::BrowserContext* browser_context,
    const extensions::Extension* extension,
    bool is_update) {}

void SupervisedUserExtensionsManager::OnExtensionUninstalled(
    content::BrowserContext* browser_context,
    const extensions::Extension* extension,
    extensions::UninstallReason reason) {}

SupervisedUserExtensionsManager::ExtensionState
SupervisedUserExtensionsManager::GetExtensionState(
    const extensions::Extension& extension) const {}

void SupervisedUserExtensionsManager::RefreshApprovedExtensionsFromPrefs() {}

void SupervisedUserExtensionsManager::SetActiveForSupervisedUsers() {}

void SupervisedUserExtensionsManager::
    ActivateManagementPolicyAndUpdateRegistration() {}

// TODO(crbug.com/40685974): We don't need the extension version information.
// It's only included for backwards compatibility with previous versions of
// Chrome. Remove the version information once a sufficient number of users have
// migrated away from M83.
void SupervisedUserExtensionsManager::UpdateApprovedExtension(
    const std::string& extension_id,
    const std::string& version,
    ApprovedExtensionChange type) {}

std::u16string SupervisedUserExtensionsManager::GetExtensionsLockedMessage()
    const {}

void SupervisedUserExtensionsManager::ChangeExtensionStateIfNecessary(
    const std::string& extension_id) {}

bool SupervisedUserExtensionsManager::ShouldBlockExtension(
    const std::string& extension_id) const {}

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
void SupervisedUserExtensionsManager::
    MaybeMarkExtensionsLocallyParentApproved() {}

void SupervisedUserExtensionsManager::DoExtensionsMigrationToParentApproved() {}
#endif  // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)

bool SupervisedUserExtensionsManager::IsLocallyParentApprovedExtension(
    const std::string& extension_id) const {}

void SupervisedUserExtensionsManager::RemoveLocalParentalApproval(
    const std::set<std::string> extension_ids) {}

void SupervisedUserExtensionsManager::
    OnSkipParentApprovalToInstallExtensionsChanged() {}

}  // namespace extensions