• Jacob Dufault's avatar
    cros: Cleanup shelf background animator · 11811235
    Jacob Dufault authored
    ShelfBackgroundAnimator determined color by looking at both ShelfBackgroundType
    and also the session state. ShelfBackgroundType was set from ShelfLayoutManager.
    
    Both ShelfLayoutManager and ShelfBackgroundAnimator observed session state
    changes and updated the shelf colors from that. This means that there were
    multiple color updates, and beyond that the rendered background type could
    diverge from what was requested by ShelfLayoutManager in the time between the
    two callbacks.
    
    Remove the ability for ShelfLayoutManager to observe session state changes, and
    encode the needed information in ShelfBackgroundType. This simplifies control
    flow and reduces complexity.
    
    Bug: 857221
    Change-Id: I173e8cc47d7f6f22123814d341a94749472f7932
    Reviewed-on: https://chromium-review.googlesource.com/1168028
    Commit-Queue: Jacob Dufault <jdufault@chromium.org>
    Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
    Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#582259}
    11811235
shelf_layout_manager_unittest.cc 94.9 KB