chromium/components/page_image_service/metrics_util.h

// Copyright 2023 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_PAGE_IMAGE_SERVICE_METRICS_UTIL_H_
#define COMPONENTS_PAGE_IMAGE_SERVICE_METRICS_UTIL_H_

#include <string>

#include "base/metrics/histogram_functions.h"
#include "components/page_image_service/mojom/page_image_service.mojom.h"

namespace page_image_service {

constexpr char kBackendHistogramName[] =;
constexpr char kBackendOptimizationGuideResultHistogramName[] =;
constexpr char kBackendSuggestResultHistogramName[] =;
constexpr char kConsentStatusHistogramName[] =;

// Used in UMA. Must not be renumbered, and must be kept in sync with enums.xml.
enum class PageImageServiceBackend {};

// Used in UMA. Must not be renumbered, and must be kept in sync with enums.xml.
enum class PageImageServiceResult {};

// Used in UMA. Must not be renumbered, and must be kept in sync with enums.xml.
enum class PageImageServiceConsentStatus {};

// Returns a string for each `client_id`. Always returns a non-empty string.
// The returned string doesn't have a period prefixing it.
std::string ClientIdToString(mojom::ClientId client_id);

template <typename T>
void UmaHistogramEnumerationForClient(const std::string& name,
                                      T sample,
                                      mojom::ClientId client_id) {}

}  // namespace page_image_service

#endif  // COMPONENTS_PAGE_IMAGE_SERVICE_METRICS_UTIL_H_