• Toni Barzic's avatar
    Reland "Fix ShelfNavigationWidget metrics reporting" · 3f8e2634
    Toni Barzic authored
    This is a reland of 387397c7
    
    The test that started failing after original cl landed was fixed in
    CL:2333742
    
    TBR=andrewxu@chromium.org
    (The change is identical to the original)
    
    Original change's description:
    > Fix ShelfNavigationWidget metrics reporting
    >
    > Update shelf navigation widget metrics reporter to use the hotseat
    > state from the time of reporter callback creation to select which
    > hotseat state dependant metric to report. Note that shelf component
    > layout happens after the hotseat state is set, so the hotseat state
    > should have the desired value by the time navigation widget transitions
    > start.
    >
    > The report callback is run asynchronously from the time the animation
    > completes, so the hotseat state can change between the hotseat animation
    > changing and the reporter callback running (e.g. if an app window is
    > closed just after the animation to hidden hotseat ends, which may happen
    > in perf tests). With the existing logic, where the reporter uses the
    > current hotseat state to select the histogram to report, the animation
    > may get registered for an incorrect transition.
    >
    > Also, when animating home button bounds, do not request animation, and
    > create metrics reporter if the view is already animating to the same
    > target bounds.
    >
    > BUG=1108641
    > TEST=ran ui.HotseatAnimation tast tests a couple of times
    >
    > Change-Id: Idde82ce98545d7ee7e54170abea588c9793e6d3d
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2333141
    > Reviewed-by: Andrew Xu <andrewxu@chromium.org>
    > Commit-Queue: Toni Baržić <tbarzic@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#793793}
    
    Bug: 1108641
    Change-Id: I0c01f1d229937c02f7d511ba833b144d09bed2c9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336781Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
    Commit-Queue: Toni Baržić <tbarzic@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#794632}
    3f8e2634
shelf.cc 24.4 KB