chromium/chrome/browser/media/media_engagement_score.cc

// Copyright 2017 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/media/media_engagement_score.h"

#include <string_view>
#include <utility>

#include "base/metrics/field_trial_params.h"
#include "base/time/time.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/site_engagement/content/site_engagement_metrics.h"
#include "media/base/media_switches.h"

const char MediaEngagementScore::kVisitsKey[] =;
const char MediaEngagementScore::kMediaPlaybacksKey[] =;
const char MediaEngagementScore::kLastMediaPlaybackTimeKey[] =;
const char MediaEngagementScore::kHasHighScoreKey[] =;

const char MediaEngagementScore::kScoreMinVisitsParamName[] =;
const char MediaEngagementScore::kHighScoreLowerThresholdParamName[] =;
const char MediaEngagementScore::kHighScoreUpperThresholdParamName[] =;

base::TimeDelta kScoreExpirationDuration =;

namespace {

const int kScoreMinVisitsParamDefault =;
const double kHighScoreLowerThresholdParamDefault =;
const double kHighScoreUpperThresholdParamDefault =;

base::Value::Dict GetMediaEngagementScoreDictForSettings(
    const HostContentSettingsMap* settings,
    const url::Origin& origin) {}

void GetIntegerFromScore(const base::Value::Dict& dict,
                         std::string_view key,
                         int* out) {}

}  // namespace

// static.
double MediaEngagementScore::GetHighScoreLowerThreshold() {}

// static.
double MediaEngagementScore::GetHighScoreUpperThreshold() {}

// static.
int MediaEngagementScore::GetScoreMinVisits() {}

MediaEngagementScore::MediaEngagementScore(base::Clock* clock,
                                           const url::Origin& origin,
                                           HostContentSettingsMap* settings)
    :{}

MediaEngagementScore::MediaEngagementScore(base::Clock* clock,
                                           const url::Origin& origin,
                                           base::Value::Dict score_dict,
                                           HostContentSettingsMap* settings)
    :{}

// TODO(beccahughes): Add typemap.
media::mojom::MediaEngagementScoreDetailsPtr
MediaEngagementScore::GetScoreDetails() const {}

MediaEngagementScore::~MediaEngagementScore() = default;

MediaEngagementScore::MediaEngagementScore(MediaEngagementScore&&) = default;
MediaEngagementScore& MediaEngagementScore::operator=(MediaEngagementScore&&) =
    default;

void MediaEngagementScore::Commit(bool force_update) {}

void MediaEngagementScore::IncrementMediaPlaybacks() {}

bool MediaEngagementScore::UpdateScoreDict(bool force_update) {}

void MediaEngagementScore::Recalculate() {}

void MediaEngagementScore::SetVisits(int visits) {}

void MediaEngagementScore::SetMediaPlaybacks(int media_playbacks) {}