Print Preview Refresh: Fix Save as PDF bug
Print Preview's destination and capabilities update process works as follows: (1) The destination associated with the destination-list-item selected by the user is sent to the destination store. Call this item-destination. (2) destination store sets |selectedDestination_| to the destination in its destinations map that has a matching key to item-destination, and requests capabilities for item-destination. (3) When capabilities are returned from the handler, the store updates |selectedDestination_| if item-destination, the destination for which they were retrieved, matches |selectedDestination_|. (4) This update transitions the UI to a ready state. When the user signs in successfully, the destinations map is completely reset. The Save as PDF destination is recreated just after reset and the recreated Save as PDF printer is added to the map. However, this was not triggering an update to the destination associated with the destination-list-item displaying the Save as PDF printer, because the new Save as PDF destination has all the same properties as the old one. As a result, if this destination was selected, the capabilities were retrieved for the old Save as PDF destination, while the |selectedDestination_| was the new destination. This mismatch caused the destination update event to never be fired, so the UI was stuck in a non-ready state. This CL forces the destination list used by the destination-list-items to update when the destination store updates its map, which ensures the list item for the Save as PDF printer gets the updated Save as PDF destination from the destination store's map. Bug: 895769 Change-Id: I1052609eddb2c240ece4e3132b829fb6b10ef35c Reviewed-on: https://chromium-review.googlesource.com/c/1284708 Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by:Demetrios Papadopoulos <dpapad@chromium.org> Cr-Commit-Position: refs/heads/master@{#602053}
Showing
Please register or sign in to comment