Move SigninManager::IsSignoutProhibited to SigninClient
The old SigninManager::IsSignoutProhibited() had a few smells 1. callers of SM::SignOut() were expected to always call SignOut() even when prohibited. This allowed the *chrome* client to do special cleanup. 2. ProhibitSignout() was really meant to narrowly prohibit user-triggered sign-out for scenarios like cloud-managed accounts. But the prohibition was applied broadly for all SignOut() calls, leading to weird states when sign-out was triggered for internal reasons (e.g. cloud policy changes). These issues came up in planning an analogous API for the new IdentityManager. This CL implements the proposed fixes https://docs.google.com/document/d/14esaufZT0fr258zL5I69y7YBBc24XsxtDU0B7wpWxBo/edit#bookmark=id.t69fnqpy377k Namely: - Prohibiting sign-out is now up to the SigninClient. SignOut() signals the source of the sign-out (user-driven vs internal reasons) and the client runs a callback indicating whether the sign-out may continue. - signin_util::SetUserSignoutAllowedForProfile() chrome/ code allow/block user-driven sign-outs. - Other implementers of SigninClient never block sign-out and are unchanged. NOTE: For now, signin_util::SetUserSignoutAllowedForProfile() actually prohibits most non-user-driven signouts to avoid changing sign-out behavior in this large plumbing CL. This will change in a follow up CL where non-user-driven sign-outs are always permitted. https://chromium-review.googlesource.com/c/chromium/src/+/1175797/ Bug: 866518 Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs Change-Id: I4758706d796f953cbb68ff1b4a0c8d2985d12fb3 Reviewed-on: https://chromium-review.googlesource.com/1162173 Commit-Queue: Chrome Cunningham <chcunningham@chromium.org> Reviewed-by:Mihai Sardarescu <msarda@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Reviewed-by:
Colin Blundell <blundell@chromium.org> Reviewed-by:
Boris Sazonov <bsazonov@chromium.org> Cr-Commit-Position: refs/heads/master@{#595214}
Showing
Please register or sign in to comment