<!--
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.
-->

<!--
This file is used to generate a comprehensive list of Personal Context
histograms along with a detailed description for each histogram.

For best practices on writing histogram descriptions, see
https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md

Please follow the instructions in the OWNERS file in this directory to find a
reviewer. If no OWNERS file exists, please consider signing up at
go/reviewing-metrics (Googlers only), as all subdirectories are expected to
have an OWNERS file. As a last resort you can send the CL to
chromium-metrics-reviews@google.com.
-->

<histogram-configuration>

<histograms>

<!-- LINT.IfChange(ContextMemoryFeature) -->

<variants name="ContextMemoryFeature">
  <variant name="AmbientAutofill" summary="Ambient Autofill"/>
  <variant name="AtMemory" summary="AtMemory"/>
  <variant name="AutoTodos" summary="AutoTodos"/>
  <variant name="SmartSearch" summary="Smart Search"/>
  <variant name="Unspecified" summary="Unspecified feature"/>
</variants>

<!-- LINT.ThenChange(//components/personal_context/core/context_memory_features.cc:ContextMemoryFeature) -->

<histogram name="PersonalContext.AmbientAutofill.NoticeInteractions"
    enum="PopupNoticeInteractions" expires_after="2027-03-09">
  <owner>alimariam@google.com</owner>
  <owner>chrome-browser-privacy-team@google.com</owner>
  <summary>
    Records the user interaction with the privacy notice in the Ambient Autofill
    bottom sheet.
  </summary>
</histogram>

<histogram name="PersonalContext.AtMemory.NoticeInteractions"
    enum="PopupNoticeInteractions" expires_after="2027-03-09">
  <owner>lamzin@google.com</owner>
  <owner>chrome-browser-privacy-team@google.com</owner>
  <summary>
    Records the user interaction with the privacy notice in the AtMemory bottom
    sheet. Recorded when the notice is shown to the user, and when the user
    acknowledges it.
  </summary>
</histogram>

<histogram name="PersonalContext.DecryptEntity.Latency" units="microseconds"
    expires_after="2027-08-18">
  <owner>sophiechang@chromium.org</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records the duration in microseconds to decrypt an encrypted entity payload
    and parse the resulting DecryptedEntity proto in PersonalContextService.
    Recorded on every decryption attempt.
  </summary>
</histogram>

<histogram name="PersonalContext.DecryptEntity.Result" enum="BooleanSuccess"
    expires_after="2027-08-18">
  <owner>sophiechang@chromium.org</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records whether an encrypted entity was successfully decrypted and parsed in
    PersonalContextService. Recorded on every decryption attempt.
  </summary>
</histogram>

<histogram name="PersonalContext.DecryptEntity.Status"
    enum="PersonalContextDecryptionStatus" expires_after="2027-08-18">
  <owner>sophiechang@chromium.org</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records the outcome status (success or specific failure cause) when
    decrypting an entity in PersonalContextService. Recorded on every decryption
    attempt.
  </summary>
</histogram>

<histogram
    name="PersonalContext.FetchContext.ErrorStatus.{ContextMemoryFeature}"
    enum="ContextMemoryExecutionError" expires_after="2026-11-15">
  <owner>qiaoli@google.com</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records the specific execution error code when fetching context from the
    Context Memory Service fails for the {ContextMemoryFeature} capability.
    Recorded on request failure.
  </summary>
  <token key="ContextMemoryFeature" variants="ContextMemoryFeature"/>
</histogram>

<histogram name="PersonalContext.FetchContext.Latency.{ContextMemoryFeature}"
    units="ms" expires_after="2027-01-24">
  <owner>qiaoli@google.com</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records the duration in milliseconds taken to completely fetch context from
    the Context Memory Service for the {ContextMemoryFeature} capability.
    Recorded upon request completion or failure.
  </summary>
  <token key="ContextMemoryFeature" variants="ContextMemoryFeature"/>
</histogram>

<histogram name="PersonalContext.FetchContext.Result.{ContextMemoryFeature}"
    enum="BooleanSuccess" expires_after="2026-11-15">
  <owner>qiaoli@google.com</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records whether the context was successfully fetched from the Context Memory
    Service for the {ContextMemoryFeature} capability. Recorded upon request
    completion or failure.
  </summary>
  <token key="ContextMemoryFeature" variants="ContextMemoryFeature"/>
</histogram>

<histogram
    name="PersonalContext.FetchPiiEntities.ErrorStatus.{ContextMemoryFeature}"
    enum="ContextMemoryExecutionError" expires_after="2026-11-15">
  <owner>qiaoli@google.com</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records the specific execution error code when fetching PII entities from
    the Context Memory Service for the {ContextMemoryFeature} capability.
    Recorded on request failure.
  </summary>
  <token key="ContextMemoryFeature" variants="ContextMemoryFeature"/>
</histogram>

<histogram
    name="PersonalContext.FetchPiiEntities.Latency.{ContextMemoryFeature}"
    units="ms" expires_after="2026-11-15">
  <owner>qiaoli@google.com</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records the duration in milliseconds taken to completely fetch PII entities
    from the Context Memory Service for the {ContextMemoryFeature} capability.
    Recorded upon request completion or failure.
  </summary>
  <token key="ContextMemoryFeature" variants="ContextMemoryFeature"/>
</histogram>

<histogram
    name="PersonalContext.FetchPiiEntities.Result.{ContextMemoryFeature}"
    enum="BooleanSuccess" expires_after="2026-11-15">
  <owner>qiaoli@google.com</owner>
  <owner>chrome-memory-context-eng@google.com</owner>
  <summary>
    Records whether the PII entities were successfully fetched from the Context
    Memory Service for the {ContextMemoryFeature} capability. Recorded upon
    request completion or failure.
  </summary>
  <token key="ContextMemoryFeature" variants="ContextMemoryFeature"/>
</histogram>

<histogram
    name="PersonalContext.NoticeImpressionsBeforeAck.{ContextMemoryFeature}"
    units="counts" expires_after="2027-03-09">
  <owner>dullweber@chromium.org</owner>
  <owner>chrome-browser-privacy-team@google.com</owner>
  <summary>
    Records the number of times the Personal Context notice was shown to the
    user on screen before it was explicitly acknowledged. Recorded when the user
    acknowledges the notice.
  </summary>
  <token key="ContextMemoryFeature" variants="ContextMemoryFeature"/>
</histogram>

<histogram
    name="PersonalContext.NoticeImpressionsBeforeImplicitAck.AmbientAutofill"
    units="counts" expires_after="2027-03-09">
  <owner>dullweber@chromium.org</owner>
  <owner>chrome-browser-privacy-team@google.com</owner>
  <summary>
    Records the number of times the Personal Context Ambient Autofill notice was
    shown to the user on screen before it was implicitly acknowledged (by
    acknowledging a more comprehensive notice like AtMemory). Recorded when the
    user acknowledges the more comprehensive notice.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
