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

// Do not edit this file manually. See README.chromium for details on
// how to edit this file.

syntax = 'proto2';

option optimize_for = LITE_RUNTIME;
option java_package = 'org.chromium.components.omnibox.metrics';
option java_outer_classname = 'SmartComposeStatsProto';

package omnibox.metrics;

// This tracks metrics related to smart compose features in searchbox (a.k.a.
// inlined autocomplete) that cannot be captured by the existing SearchboxStats.
message SmartComposeStats {
  // The manner in which the suggestion was accepted.
  // Next available ID: 5
  enum AcceptMethod {
    ACCEPT_METHOD_UNSPECIFIED = 0;
    TAP = 1;
    SWIPE = 2;
    GBOARD_SWIPE = 3;
    ACCESSIBILITY_ACTION = 4;
  }

  // True when a searchbox has smart compose enabled.
  optional bool enabled = 1;

  // The number of times an edit resulted in a smart compose suggestion being
  // rendered to the user.
  optional int32 shown_count = 2;

  // The number of times a user accepted a smart compose suggestion.
  optional int32 accepted_count = 3;

  // The sum of the length of accepted smart compose completions.
  optional int32 characters_accepted = 4;

  // The sum of the length of shown smart compose completions.
  optional int32 shown_length = 5;

  // Tracks how the user accepted each suggestion on their device.
  repeated AcceptMethod accept_methods = 6;

  // The indices of the query when a smart compose suggestion was impressed.
  repeated int32 impressed_index = 7;

  // A sparse array of indices when the smart compose suggestion was accepted.
  repeated int32 accepted_at_index = 8;
}
