• Peter Kasting's avatar
    Refactor DownloadItemView state transitions, part 3. · 316bd1dd
    Peter Kasting authored
    This adds a helper, UpdateLabels(), to set all labels' visibility, text,
    and style based on the current mode; this replaces the scattered pieces
    throughout other functions.
    
    The file name label's style changes based not on the mode but on the
    enabled state of the whole view; update that in the functions that set
    the view's enabled state.
    
    The above two changes mean that UpdateColorsFromTheme() now only deals
    with colors, and thus no longer need be called outside OnThemeChanged().
    
    Renames |dangerous_download_label_| to the more accurate (and shorter!)
    |warning_label_|.
    
    For some reason UpdateMode() was also sometimes setting the file name
    label's Y coordinate.  This is done in layout, and there's no reason to
    do it here.
    
    Bug: none
    Change-Id: Ib7b9b77cc8ba11af609d9e25328f9207da66f6d1
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299141
    Commit-Queue: Peter Kasting <pkasting@chromium.org>
    Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#788914}
    316bd1dd
download_item_view.cc 53.9 KB