[Instant Start] Shows identity disc button on Start Surface.
When Instant Start is enabled, the calculateButtonData() is called pre-native and early exits without calling the IdentityDiscController#ensureProfileDataCache(). As a result, the IdentityDiscController misses the event of the onProfileDataUpdated() and thus doesn't notify its observer StartSurfaceToolbarMediator to update the visibility of the identity disc button. To fix the issue, we cache the call of calculateButtonData() from the Start surface if it is called pre-native. When a new Profile is set, we check if a cached request exists, and call the calculateButtonData() if yes. Thus, it guarantees to update the button data if Profile has updated, as well as to notify Start Surface to update the visibility of the button. Bug: 1137535 Change-Id: I3aca4434ecc74850ee226affd3c3425931cf02a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533522Reviewed-by:Pavel Yatsuk <pavely@chromium.org> Commit-Queue: Xi Han <hanxi@chromium.org> Cr-Commit-Position: refs/heads/master@{#828362}
Showing
Please register or sign in to comment