chromium/components/privacy_sandbox/privacy_sandbox_notice_storage.cc

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

#include "components/privacy_sandbox/privacy_sandbox_notice_storage.h"

#include <string>

#include "base/json/values_util.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "components/prefs/pref_registry.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/privacy_sandbox/privacy_sandbox_notice_constants.h"

namespace privacy_sandbox {
namespace {

// Notice data will be saved as a dictionary in the PrefService of a profile.

// PrefService path.
constexpr char kPrivacySandboxNoticeDataPath[] =;

// Unsynced pref that indicates the schema version this profile is using in
// regards to the data model.
constexpr char kPrivacySandboxSchemaVersion[] =;

// Unsynced pref that indicates the action taken relating to the notice.
constexpr char kPrivacySandboxNoticeActionTaken[] =;

// Unsynced pref that indicates the timestamp at which the action was taken. The
// action taken can be determined by the `notice_action_taken` pref.
constexpr char kPrivacySandboxNoticeActionTakenTime[] =;

// Unsynced pref that indicates when the notice was first shown. If this value
// isn't set, we can assume the notice was never shown.
constexpr char kPrivacySandboxNoticeFirstShown[] =;

// Unsynced pref that indicates when the notice was last shown across all
// sessions.
constexpr char kPrivacySandboxNoticeLastShown[] =;

// Unsynced pref that indicates the duration of how long the notice was shown
// across all sessions to when a user took action.
constexpr char kPrivacySandboxNoticeShownDuration[] =;

std::string CreatePrefPath(std::string_view notice,
                           std::string_view pref_name) {}

void CreateTimingHistogram(const std::string& name, base::TimeDelta sample) {}

std::string GetNoticeActionString(NoticeActionTaken action) {}

void SetSchemaVersion(PrefService* pref_service, std::string_view notice) {}

void CheckNoticeNameEligibility(std::string_view notice_name) {}

}  // namespace

// PrivacySandboxNoticeData definitions.
PrivacySandboxNoticeData::PrivacySandboxNoticeData() = default;
PrivacySandboxNoticeData& PrivacySandboxNoticeData::operator=(
    const PrivacySandboxNoticeData&) = default;
PrivacySandboxNoticeData::~PrivacySandboxNoticeData() = default;

// PrivacySandboxNoticeStorage definitions.
void PrivacySandboxNoticeStorage::RegisterProfilePrefs(
    PrefRegistrySimple* registry) {}

void PrivacySandboxNoticeStorage::RecordHistogramsOnStartup(
    PrefService* pref_service,
    std::string_view notice) const {}

std::optional<PrivacySandboxNoticeData>
PrivacySandboxNoticeStorage::ReadNoticeData(PrefService* pref_service,
                                            std::string_view notice) const {}

void PrivacySandboxNoticeStorage::SetNoticeActionTaken(
    PrefService* pref_service,
    std::string_view notice,
    NoticeActionTaken notice_action_taken,
    base::Time notice_action_taken_time) {}

void PrivacySandboxNoticeStorage::SetNoticeShown(PrefService* pref_service,
                                                 std::string_view notice,
                                                 base::Time notice_shown_time) {}

void PrivacySandboxNoticeStorage::MigratePrivacySandboxNoticeData(
    PrefService* pref_service,
    const PrivacySandboxNoticeData& input,
    std::string_view notice) {}

}  // namespace privacy_sandbox