• Peter Kasting's avatar
    Reland "Refactor DownloadItemView state transitions, part 4." · c09a270d
    Peter Kasting authored
    This is a reland of 43713035
    
    Accidental empty-bitmap-check-reversal undone.
    
    Original change's description:
    > Refactor DownloadItemView state transitions, part 4.
    >
    > Renames LoadIcon() to UpdateFilePath() and moves it to be with the other
    > Update...() functions, since it doesn't unconditionally load, but rather
    > updates the file path, and conditionally loads if the path has changed.
    >
    > With the goal of greater consistency, renames |last_download_item_path_|
    > to |file_path_|, |icon_| to |file_icon_|, and OnExtractIconComplete() to
    > OnFileIconLoaded().
    >
    > Finally, makes a few tweaks around invalidation:
    > * Explicit Layout() calls should be InvalidateLayout(); this will result
    >   in a SchedulePaint() if anything moves, so the explicit
    >   SchedulePaint() at the end of UpdateMode() can be dropped.
    > * It's not clear to me why loading the icons would schedule a paint on
    >   the shelf instead of |this|.  If there are other items on the shelf
    >   referring to these same icons, they have tasks of their own.  Instead,
    >   just SchedulePaint() when the file icon loads (large or small).
    >
    > Bug: none
    > Change-Id: I2a7c5af7dcbe9bc489b18bc6a58e1183477a7027
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299180
    > Commit-Queue: Peter Kasting <pkasting@chromium.org>
    > Reviewed-by: Min Qin <qinmin@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#788927}
    
    Bug: none
    Change-Id: Ia8a06b3c6516443d6cb2ab49fbc64240c9347808
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303449
    Auto-Submit: Peter Kasting <pkasting@chromium.org>
    Commit-Queue: Min Qin <qinmin@chromium.org>
    Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#789502}
    c09a270d
download_item_view.cc 53.8 KB