• Peter Kasting's avatar
    Refactor DownloadItemView state transitions, part 2. · fdf18312
    Peter Kasting authored
    This adds a helper, UpdateButtons(), to set all buttons' visibility,
    text, and enabled state based on the current mode; this replaces the
    scattered pieces throughout other functions.
    
    This also removes the places that set |dropdown_state_| to NORMAL.
    Since this is supposed to track the actual button state, it only makes
    sense to toggle it in places like ButtonPressed() and ReleaseDropdown().
    It also doesn't make sense to change this variable directly instead of
    going through SetDropdownState(), since then the state and the visual
    appearance could be out of sync.
    
    Bug: none
    Change-Id: I444fd3b14ab1ec8a4b0aed37ce2d80539d54f199
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299139
    Commit-Queue: Peter Kasting <pkasting@chromium.org>
    Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#788861}
    fdf18312
download_ui_model.cc 22.7 KB