chromium/components/language/core/browser/url_language_histogram.h

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

#ifndef COMPONENTS_LANGUAGE_CORE_BROWSER_URL_LANGUAGE_HISTOGRAM_H_
#define COMPONENTS_LANGUAGE_CORE_BROWSER_URL_LANGUAGE_HISTOGRAM_H_

#include <string>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "components/keyed_service/core/keyed_service.h"

class PrefRegistrySimple;
class PrefService;

namespace language {

// Collects data about languages in which the user reads the web and provides
// access to current estimated language preferences. The past behaviour is
// discounted so that the histogram reflects changes in browsing habits. This
// histogram does not have to contain all languages that ever appeared in user's
// browsing, languages with insignificant frequency are removed, eventually.
//
// Operates as a "wrapper" around profile preferences: the state of the
// histogram is read from/written to the PrefService in each method call. This
// allows multiple instances of the histogram to be used in a (non-overlapping)
// sequence without any instance-specific state going "out of sync". This
// behaviour is relied on by clients of the histogram.
class UrlLanguageHistogram : public KeyedService {};

}  // namespace language

#endif  // COMPONENTS_LANGUAGE_CORE_BROWSER_URL_LANGUAGE_HISTOGRAM_H_