#include "components/language/core/browser/url_language_histogram.h"
#include <algorithm>
#include <map>
#include <set>
#include "components/prefs/pref_registry.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
namespace language {
namespace {
const char kUrlLanguageHistogramCounters[] = …;
const int kMaxCountersSum = …;
const int kMinCountersSum = …;
const float kCutoffRatio = …;
const float kDiscountFactor = …;
int GetCountersSum(const base::Value::Dict& dict) { … }
void DiscountAndCleanCounters(base::Value::Dict& dict) { … }
std::vector<UrlLanguageHistogram::LanguageInfo> GetAllLanguages(
const base::Value::Dict& dict) { … }
}
UrlLanguageHistogram::UrlLanguageHistogram(PrefService* pref_service)
: … { … }
UrlLanguageHistogram::~UrlLanguageHistogram() = default;
void UrlLanguageHistogram::RegisterProfilePrefs(PrefRegistrySimple* registry) { … }
std::vector<UrlLanguageHistogram::LanguageInfo>
UrlLanguageHistogram::GetTopLanguages() const { … }
float UrlLanguageHistogram::GetLanguageFrequency(
const std::string& language_code) const { … }
void UrlLanguageHistogram::OnPageVisited(const std::string& language_code) { … }
void UrlLanguageHistogram::ClearHistory(base::Time begin, base::Time end) { … }
}