Commit a1f352c9 authored by Sébastien Séguin-Gagnon's avatar Sébastien Séguin-Gagnon Committed by Commit Bot

[SH] Change the LinkOpenSource from boolean to enum histogram.

The histograms.xml already mentioned the enum.

Bug: 1138614
Change-Id: I6552185daf485e09ffe24063382f3b8f89433c7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2473037Reviewed-by: default avatarGayane Petrosyan <gayane@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: sebsg <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817464}
parent 2c514cda
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics.h" #include "third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics.h"
#include "base/check.h" #include "base/check.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/time/default_tick_clock.h" #include "base/time/default_tick_clock.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
...@@ -182,8 +183,10 @@ void TextFragmentAnchorMetrics::ReportMetrics() { ...@@ -182,8 +183,10 @@ void TextFragmentAnchorMetrics::ReportMetrics() {
time_to_scroll_into_view.InMilliseconds()); time_to_scroll_into_view.InMilliseconds());
} }
UMA_HISTOGRAM_BOOLEAN("TextFragmentAnchor.LinkOpenSource", base::UmaHistogramEnumeration("TextFragmentAnchor.LinkOpenSource",
has_search_engine_source_); has_search_engine_source_
? TextFragmentLinkOpenSource::kSearchEngine
: TextFragmentLinkOpenSource::kUnknown);
#ifndef NDEBUG #ifndef NDEBUG
metrics_reported_ = true; metrics_reported_ = true;
#endif #endif
......
...@@ -40,6 +40,14 @@ class CORE_EXPORT TextFragmentAnchorMetrics final ...@@ -40,6 +40,14 @@ class CORE_EXPORT TextFragmentAnchorMetrics final
kMaxValue = kTextRangeWithContext, kMaxValue = kTextRangeWithContext,
}; };
// Update corresponding |TextFragmentLinkOpenSource| in enums.xml.
enum class TextFragmentLinkOpenSource {
kUnknown,
kSearchEngine,
kMaxValue = kSearchEngine,
};
explicit TextFragmentAnchorMetrics(Document* document); explicit TextFragmentAnchorMetrics(Document* document);
static TextFragmentAnchorParameters GetParametersForSelector( static TextFragmentAnchorParameters GetParametersForSelector(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment