• Marc Treib's avatar
    Decouple Sync-the-transport from Sync-the-feature, part 2: non-primary accounts · 135720d7
    Marc Treib authored
    This adds support for starting Sync-the-transport even when there is no
    primary (aka signed-into-Chrome aka blessed-for-Sync-the-feature)
    account.
    This is implemented by SyncAuthManager listening for OnAccountsInCookieUpdated,
    and using the first cookie account if there is no primary account and we have
    a refresh token for the first cookie account. This also makes it necessary to
    cache the current Sync account, so that we can detect changes to it.
    
    IsSyncFeatureEnabled now also checks that the current account is the primary
    one, so that we don't accidentally enable full Sync for a secondary account.
    
    Bug: 871221
    Change-Id: I07c7db04cc92e9a40126c89c0fcfea49e03117d1
    Reviewed-on: https://chromium-review.googlesource.com/1162174
    Commit-Queue: Marc Treib <treib@chromium.org>
    Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#587082}
    135720d7
sync_driver_switches.cc 4.55 KB