chromium/chrome/browser/ui/webui/print_preview/print_preview_metrics.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 CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_METRICS_H_
#define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_METRICS_H_

#include <cstddef>

#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "printing/mojom/print.mojom-forward.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/crosapi/mojom/extension_printer.mojom-forward.h"
#endif

namespace base {
class TimeTicks;
}  // namespace base

namespace printing {

// This enum is used to back an UMA histogram, and should therefore be treated
// as append only.
enum class PrintDocumentTypeBuckets {};

// This enum is used to back an UMA histogram, and should therefore be treated
// as append only.
enum class PrintSettingsBuckets {};

// This enum is used to back an UMA histogram, and should therefore be treated
// as append only.
enum class UserActionBuckets {};

// Record the number of local printers.
void ReportNumberOfPrinters(size_t number);

void ReportPrintDocumentTypeHistograms(PrintDocumentTypeBuckets doctype);

// Track the popularity of print settings and report the stats.
void ReportPrintSettingsStats(const base::Value::Dict& print_settings,
                              const base::Value::Dict& preview_settings,
                              bool is_pdf);

void ReportUserActionHistogram(UserActionBuckets event);

void RecordGetPrintersTimeHistogram(mojom::PrinterType printer_type,
                                    const base::TimeTicks& start_time);

#if BUILDFLAG(IS_CHROMEOS_ASH)
// Record the print job status sending to lacros extension printers from ash.
void ReportLacrosExtensionPrintJobStatusFromAshHistogram(
    crosapi::mojom::StartPrintStatus status);
#endif

}  // namespace printing

#endif  // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_METRICS_H_