Avoid sending GoogleSigninSucceeded notifications on reauth.
The desktop re-authentication flow does not update the sign-in manager. Here are the explinations why: * SigninManager::StartSigninWithRefreshToken dchecks that the profile is not authenticated (see https://cs.chromium.org/chromium/src/components/signin/core/browser/signin_manager.cc?rcl=a2b0b2c00ad3b7c02b57fe86b9feba1a4c5221fd&l=105) * InlineSigninHandler simply updates the refresh tokens in case of a reauth (see https://cs.chromium.org/chromium/src/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc?rcl=a2b0b2c00ad3b7c02b57fe86b9feba1a4c5221fd&l=246 ) The mobile re-auth flow calls SigninManager::OnExternalSignin which in some cases may lead to a unexpected call to GoogleSigninSucceeded. On iOS this flow does not exists as the iSL always removes invalid accounts. On Android, there is a possibility for the SigninManager::OnExternalSignin to be called in a reauth flow, however the Java code ignores GoogleSigninSucceeded notifications (see https://cs.chromium.org/chromium/src/chrome/browser/android/signin/signin_manager_android.cc?rcl=a2b0b2c00ad3b7c02b57fe86b9feba1a4c5221fd&l=347) This CL makes it explicit that: * SigninManager does not send GoogleSigninSucceeded notifications on reauth * Adds a DCHECK when the authenticated account ID is changed. TBR=mpearson@chromium.org Bug: 733226 Change-Id: I85cc4497a0d099447a7d8a46b435e93f39d8d4c7 Reviewed-on: https://chromium-review.googlesource.com/579432 Commit-Queue: Mihai Sardarescu <msarda@chromium.org> Reviewed-by:David Roger <droger@chromium.org> Reviewed-by:
Roger Tawa <rogerta@chromium.org> Reviewed-by:
Pavel Yatsuk <pavely@chromium.org> Cr-Commit-Position: refs/heads/master@{#491983}
Showing
Please register or sign in to comment