• Matt Giuca's avatar
    SiteEngagementObserver now gets the engagement type (+ refactor). · 6bf4cfee
    Matt Giuca authored
    This is to support https://crrev.com/c/792315, which adds a new observer
    for logging engagement-type UMA in PWA app windows.
    
    The major interface changes are:
    - Renamed OnEngagementIncreased to OnEngagementEvent to indicate that it
      is now for all events that modify engagement, not just increases.
    - OnEngagementEvent is now called on launch (so now every place where an
      engagement UMA is logged also corresponds to an OnEngagementEvent).
    - OnEngagementEvent now takes an EngagementType enum, indicating what
      caused the engagement event.
    
    Because the engagement type is now exposed through the observer (and can
    therefore be used for non-metrics purposes), it has been moved out of
    SiteEngagementMetrics into SiteEngagementService.
    
    Also refactored SiteEngagementService to record UMA from the
    OnEngagementEvent method, rather than in many places.
    
    Bug: 785661
    Change-Id: I352d0363c9ee3a40293e7b99d5b8f6e75c0e999b
    Reviewed-on: https://chromium-review.googlesource.com/802661Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
    Reviewed-by: default avatarBen Wells <benwells@chromium.org>
    Commit-Queue: Matt Giuca <mgiuca@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#521639}
    6bf4cfee
launch_metrics.cc 5.54 KB