Settings WebUI: Tweak logic that shows sync cancel dialog.

The code was triggering a navigation from within a currentRouteChanged
observer, which triggers another round of observer notifications, which
resulted in observers getting in a weird state.

Unfortunately triggering a navigation from within such an observer is not
well suported from the routing mechanism (no such use case previously AFAIK).

Fixed by yielding first, such that all observers finish, before triggering
a new navigation.

Bug: 929026
Change-Id: Iee89af435bb2c8a7c738622abdc45d568173d07b
Reviewed-on: https://chromium-review.googlesource.com/c/1460398
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Reviewed-by: Thomas Tangl <tangltom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630287}
2 files changed