Popup metrics: simplify tab-under metrics

Desktop / Chromium - Charles Harrison [chromium.org] - 4 October 2017 21:13 EDT

This CL does a few things. 1. Instantiate the tab-under nav throttle unconditionally, only
*block* the navigation if the feature is enabled. This allows us to combine logic more effectively for metrics, by e.g. removing the flat set of navigations occurring in the background. For this data we can just trust the nav throttle.

2. Remove the old tab visibility metrics gated on cross origin redirects in favor of an approach that just logs 3 metrics: a. Tab.VisibleTime b. Tab.TabUnder.VisibleTime c. Tab.TabUnder.PopupToTabUnderTime I believe these three metrics are the most important, and they are now logged directly from input from the throttle, so they are comparable what will actually happen when we turn the experiment on.

3. A bug fix where we assume a navigation that started in the background, ends in the background.

4. Some new tests.

Bug: 661629 Change-Id: Idc1b82528cbf2bf2a1a94d174b4e07823ec30d17 Reviewed-on: https://chromium-review.googlesource.com/700718

537343f Popup metrics: simplify tab-under metrics
.../ui/blocked_content/popup_opener_tab_helper.cc | 83 ++++------
.../ui/blocked_content/popup_opener_tab_helper.h | 26 +---
.../popup_opener_tab_helper_unittest.cc | 168 +++++++++++++--------
.../tab_under_navigation_throttle.cc | 26 ++--
.../tab_under_navigation_throttle.h | 18 ++-
tools/metrics/histograms/enums.xml | 1 +
tools/metrics/histograms/histograms.xml | 30 ++++
7 files changed, 203 insertions(+), 149 deletions(-)

Upstream: git.chromium.org

  • Share