chromium/chrome/browser/extensions/api/storage/managed_value_store_cache.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/api/storage/managed_value_store_cache.h"

#include <memory>
#include <utility>

#include "base/memory/raw_ptr.h"
#include "base/one_shot_event.h"
#include "base/scoped_observation.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "base/types/expected.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/api/storage/policy_value_store.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/schema_registry_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/storage/storage_schema_manifest_handler.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/core/common/schema_map.h"
#include "components/policy/core/common/schema_registry.h"
#include "components/value_store/value_store_factory.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/storage/backend_task_runner.h"
#include "extensions/browser/api/storage/value_store_util.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_registry_observer.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"

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

BrowserContext;
BrowserThread;

namespace extensions {
class ExtensionRegistry;

namespace {

// Only extension settings are stored in the managed namespace - not apps.
const value_store_util::ModelType kManagedModelType =;

}  // namespace

////////////////////////////////////////////////////////////////////////////////
/// ExtensionTracker
////////////////////////////////////////////////////////////////////////////////

// This helper observes initialization of all the installed extensions and
// subsequent loads and unloads, and keeps the SchemaRegistry of the Profile
// in sync with the current list of extensions. This allows the PolicyService
// to fetch cloud policy for those extensions, and allows its providers to
// selectively load only extension policy that has users.
class ManagedValueStoreCache::ExtensionTracker
    : public ExtensionRegistryObserver {};

ManagedValueStoreCache::ExtensionTracker::ExtensionTracker(
    Profile* profile,
    policy::PolicyDomain policy_domain)
    :{}

void ManagedValueStoreCache::ExtensionTracker::OnExtensionWillBeInstalled(
    content::BrowserContext* browser_context,
    const Extension* extension,
    bool is_update,
    const std::string& old_name) {}

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

void ManagedValueStoreCache::ExtensionTracker::OnExtensionsReady() {}

void ManagedValueStoreCache::ExtensionTracker::LoadSchemas(ExtensionSet added) {}

bool ManagedValueStoreCache::ExtensionTracker::UsesManagedStorage(
    const Extension* extension) const {}

// static
void ManagedValueStoreCache::ExtensionTracker::LoadSchemasOnFileTaskRunner(
    ExtensionSet extensions,
    base::WeakPtr<ExtensionTracker> self) {}

void ManagedValueStoreCache::ExtensionTracker::Register(
    const policy::ComponentMap* components) {}

////////////////////////////////////////////////////////////////////////////////
/// ManagedValueStoreCache
////////////////////////////////////////////////////////////////////////////////

ManagedValueStoreCache::ManagedValueStoreCache(
    Profile& profile,
    scoped_refptr<value_store::ValueStoreFactory> factory,
    SettingsChangedCallback observer)
    :{}

ManagedValueStoreCache::~ManagedValueStoreCache() {}

policy::PolicyDomain ManagedValueStoreCache::policy_domain() const {}

void ManagedValueStoreCache::ShutdownOnUI() {}

void ManagedValueStoreCache::RunWithValueStoreForExtension(
    StorageCallback callback,
    scoped_refptr<const Extension> extension) {}

void ManagedValueStoreCache::DeleteStorageSoon(
    const ExtensionId& extension_id) {}

void ManagedValueStoreCache::OnPolicyServiceInitialized(
    policy::PolicyDomain domain) {}

void ManagedValueStoreCache::InitializeOnBackend() {}

void ManagedValueStoreCache::OnPolicyUpdated(const policy::PolicyNamespace& ns,
                                             const policy::PolicyMap& previous,
                                             const policy::PolicyMap& current) {}

// static
policy::PolicyDomain ManagedValueStoreCache::GetPolicyDomain(
    const Profile& profile) {}

void ManagedValueStoreCache::UpdatePolicyOnBackend(
    const ExtensionId& extension_id,
    const policy::PolicyMap& new_policy) {}

PolicyValueStore& ManagedValueStoreCache::GetOrCreateStore(
    const ExtensionId& extension_id) {}

bool ManagedValueStoreCache::HasStore(const ExtensionId& extension_id) const {}

}  // namespace extensions