• Andrew Xu's avatar
    Fix the issue that the out-dated model index is accessed · fcd04ed8
    Andrew Xu authored
    |last_visible_index_| of the main shelf view is updated in
    CalculateAppCenteringStrategy. However, when the scrollable shelf
    is enabled, |last_visible_index_| may be accessed before that function
    is called. As a result, an illegal index value may be used. Given
    that in scrollable shelf, |last_visible_index_| is always the index
    of the last shelf item. So updates |last_visible_index_| when
    a shelf item is added/removed.
    
    Bug: 1006165
    Change-Id: I4bc13e204835828bb1d5f77024ce274b9899ced0
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816142Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
    Commit-Queue: Andrew Xu <andrewxu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#699020}
    fcd04ed8
shelf_view.h 28.2 KB