Adding previews information to PLM UKM

Desktop / Chromium - ryansturm [chromium.org] - 17 July 2017 16:54 EDT

This adds four metrics to the PLM UKM for previews: "opt_out", set to true when the user hit "Show Original" on a preview; "server_lofi", "client_lofi", and "lite_page" set to true when a preview was shown. When no preview is shown, no metrics are added to the UKM.

Similarly, when the user does not opt out, nothing is added for opt_out.

This does not track offline previews yet, but may in the future.

The infobar posts an event to page_load_metrics for the web contents when the user clicks "show original" on the page.

BUG=701514,723711,728707

Review-Url: https://codereview.chromium.org/2952343004 Cr-Commit-Position: refs/heads/master@{#487238}

1806f8e Adding previews information to PLM UKM
chrome/browser/BUILD.gn | 2 +
.../metrics_web_contents_observer.cc | 6 +
.../metrics_web_contents_observer.h | 6 +
.../lofi_page_load_metrics_observer_unittest.cc | 2 +-
.../observers/previews_ukm_observer.cc | 128 +++++++
.../observers/previews_ukm_observer.h | 55 +++
.../observers/previews_ukm_observer_unittest.cc | 368 +++++++++++++++++++++
.../page_load_metrics_initialize.cc | 2 +
.../page_load_metrics/page_load_metrics_observer.h | 4 +
.../browser/page_load_metrics/page_load_tracker.cc | 6 +
.../browser/page_load_metrics/page_load_tracker.h | 5 +-
.../browser/previews/previews_infobar_delegate.cc | 21 ++
.../browser/previews/previews_infobar_delegate.h | 3 +
.../previews/previews_infobar_delegate_unittest.cc | 44 ++-
chrome/test/BUILD.gn | 1 +
services/metrics/public/cpp/ukm_recorder.h | 5 +
tools/metrics/ukm/ukm.xml | 29 ++
17 files changed, 681 insertions(+), 6 deletions(-)

Upstream: git.chromium.org


  • Share