chromium/ui/base/clipboard/clipboard_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 UI_BASE_CLIPBOARD_CLIPBOARD_METRICS_H_
#define UI_BASE_CLIPBOARD_CLIPBOARD_METRICS_H_

#include "build/build_config.h"

namespace ui {

#if BUILDFLAG(IS_CHROMEOS)
class ClipboardData;
#endif  // BUILDFLAG(IS_CHROMEOS)

// Used to log formats read/written from/to the platform clipboard.
//
// This enum's values are persisted to logs. Do not reuse or renumber values.
enum class ClipboardFormatMetric {};

void RecordRead(ClipboardFormatMetric metric);
void RecordWrite(ClipboardFormatMetric metric);

#if BUILDFLAG(IS_CHROMEOS)
// Records the time interval between when the specified |data| was committed to
// the clipboard and when it was read. Read time is assumed to be now.
void RecordTimeIntervalBetweenCommitAndRead(const ui::ClipboardData* data);
#endif  // BUILDFLAG(IS_CHROMEOS)

}  // namespace ui

#endif  // UI_BASE_CLIPBOARD_CLIPBOARD_METRICS_H_