chromium/components/translate/core/browser/translate_metrics_logger_impl.h

// Copyright 2020 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_TRANSLATE_CORE_BROWSER_TRANSLATE_METRICS_LOGGER_IMPL_H_
#define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_METRICS_LOGGER_IMPL_H_

#include <memory>
#include <optional>
#include <string>

#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "components/translate/core/browser/translate_metrics_logger.h"
#include "components/translate/core/browser/translate_prefs.h"

namespace base {
class TickClock;
}  // namespace base

namespace translate {

// Translation frequency UMA histograms.
extern const char kTranslateTranslationSourceLanguage[];
extern const char kTranslateTranslationTargetLanguage[];
extern const char kTranslateTranslationTargetLanguageOrigin[];
extern const char kTranslateTranslationStatus[];
extern const char kTranslateTranslationType[];

// UI Interaction frequency UMA histograms.
extern const char kTranslateUiInteractionEvent[];

// Page-load frequency UMA histograms.
extern const char kTranslatePageLoadFinalSourceLanguage[];
extern const char kTranslatePageLoadFinalState[];
extern const char kTranslatePageLoadFinalTargetLanguage[];
extern const char kTranslatePageLoadHrefTriggerDecision[];
extern const char kTranslatePageLoadInitialSourceLanguage[];
extern const char kTranslatePageLoadInitialState[];
extern const char kTranslatePageLoadInitialTargetLanguage[];
extern const char kTranslatePageLoadInitialTargetLanguageOrigin[];
extern const char
    kTranslatePageLoadIsInitialSourceLanguageInUsersContentLanguages[];
extern const char kTranslatePageLoadNumTargetLanguageChanges[];
extern const char kTranslatePageLoadNumTranslations[];
extern const char kTranslatePageLoadNumReversions[];
extern const char kTranslatePageLoadRankerDecision[];
extern const char kTranslatePageLoadRankerTimerShouldOfferTranslation[];
extern const char kTranslatePageLoadRankerVersion[];
extern const char kTranslatePageLoadTriggerDecision[];

// Session frequency UMA histograms.
extern const char kTranslateApplicationStartAlwaysTranslateLanguage[];
extern const char kTranslateApplicationStartAlwaysTranslateLanguageCount[];
extern const char kTranslateApplicationStartNeverTranslateLanguage[];
extern const char kTranslateApplicationStartNeverTranslateLanguageCount[];
extern const char kTranslateApplicationStartNeverTranslateSiteCount[];

class NullTranslateMetricsLogger : public TranslateMetricsLogger {};

class TranslateManager;

namespace testing {
class TranslateMetricsLoggerImplTest;
}  // namespace testing

// TranslateMetricsLogger tracks and logs various UKM and UMA metrics for Chrome
// Translate over the course of a page load.
class TranslateMetricsLoggerImpl : public TranslateMetricsLogger {};

}  // namespace translate

// TODO(curranmax): Add unit tests for this class. https://crbug.com/1114868.

#endif  // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_METRICS_LOGGER_IMPL_H_