[Instant Start] Fix IdentityDisc button isn't shown 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 call notifyObservers(true) in setProfile() when the Profile is created. It will notify the Start surface which calls IdentityDiscController#getForStartSurface() to create a ProfileDataCache if hasn't yet and listen to the event when Profile is updated. Bug: 1137535 Change-Id: I187ab8734144d61ae0a2eff761494792594e7b21 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2547200 Commit-Queue: Xi Han <hanxi@chromium.org> Reviewed-by:Pavel Yatsuk <pavely@chromium.org> Cr-Commit-Position: refs/heads/master@{#828913}
Showing
Please register or sign in to comment