• Wenzhao Zang's avatar
    cros: Implement 'My Photos' section in new wallpaper picker (Part II) · a3aeee0c
    Wenzhao Zang authored
    The old wallpaper picker must generate and save a thumbnail for each
    custom wallpaper, so that they can persist even after the original
    image file is deleted. This is not needed for the new picker:
    the thumbnails under 'My Photos' section are real-time representation
    of the files under Downloads. We do not want to cache or save them
    since the files may change all the time.
    
    Therefore, to simplify the logic, we only need to read the image data,
    and then use CSS to resize the image to display as the thumbnail
    (the same with backdrop wallpapers for consistency).
    
    The new wallpaper picker doesn't display the thumbnail of the history
    custom wallpaper like the old picker. So basically the 'generate and
    save thumbnail' code path can be deprecated in the future.
    
    Bug: 809793
    Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
    Change-Id: Ibf00bec636a52081c77cd7cf1b94e934fd97b11c
    Reviewed-on: https://chromium-review.googlesource.com/912282Reviewed-by: default avatarSteven Holte <holte@chromium.org>
    Reviewed-by: default avatarToni Barzic <tbarzic@chromium.org>
    Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#536950}
    a3aeee0c
util.js 15.5 KB