ProfileOAuth2TokenService sends an observer callback when the refresh token for an account is first added. As part of that process, AccountTrackerService also sends callbacks if metadata is set on the account (e.g., it is set to have advanced protection status).
Once all clients of these observer callbacks are instead observing the equivalent IdentityManager callbacks, we should make the semantics of these callbacks sane wrt each other (from a comment by Mihai on ):
When we send OnRefreshTokenUpdatedForAccount(AccountInfo) to our observers, the account info should already contain all informations (email, gaia id, is under advanced protection status, child account if we decide to add it later)
We should not send any notifications about account updated from the IdentityManager before we send OnRefreshTokenUpdatedForAccount. For me, the first OnRefreshTokenUpdatedForAccount identifies the moment when an account was added.
Making these changes will require going through all clients of the IdentityManager equivalent to the AccountTrackerService callback to make sure that they work or can be made to work with the new semantics. This should be doable.
Comment 1 by blundell@chromium.org
, Jan 14