• Jeffrey Young's avatar
    ambient: synchronize images among photo_views on multiple displays · 8b2bcb0f
    Jeffrey Young authored
    When a new display is added during ambient mode, make sure that each
    image view has the same images.
    
    Prior behavior:
      * OnImagesReady internal display initializes -> {0*, _}
      * internal display receives immediate OnImageAdded -> {0*, 1}
      * external display is connected -> {0*, 1}, {0*, _}
      * OnImageAdded for image 2 -> {2, 1*}, {0*, 2}
        - external display does not switch image because none on deck
      * OnImageAdded for image 3 -> {2*, 3}, {3, 2*}
    
    New behavior:
      * OnImagesReady internal display initializes -> {0*, 1}
      * external display is connected -> {0*, 1}, {0*, 1}
      * OnImageAdded for image 2 -> {2, 1*}, {2, 1*}
    
    Initialize |PhotoView| with both images stored in |AmbientBackendModel|
    to guarantee they show images in the same order. When the second
    image is added, call |OnImagesReady| after |OnImageAdded| so that
    |PhotoView| does not receive an immediate |OnImageAdded| after
    being constructed.
    
    BUG=b:173229098
    
    Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome
    Change-Id: I0f47d9a1b3748d74502080da9f0011e013897393
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2547308
    Commit-Queue: Jeffrey Young <cowmoo@chromium.org>
    Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
    Reviewed-by: default avatarTao Wu <wutao@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#837306}
    8b2bcb0f
photo_view.cc 4.99 KB