Provide IdentityManager API to replace SigninManagerBase::IsSigninAllowed |
||||||||||||||||||
Issue description
SigninManagerBase::IsSigninAllowed is backed by the preference prefs::kSigninAllowed which is controlled by policy and UI.
Many places in the UI and tests tweak the preference and/or wait for the preference to change. The API to replace the use of IsSigninAllowed should either 1. allow to watch for change to the state and to integrate with policy, or 2. remove use of the preference from signin internal, and have embedder control the state.
Option 1. would correspond to an API looking like:
class IdentityManager {
class Observer {
virtual void OnSigninAllowedChanged(bool signin_allowed);
...
};
bool IsSigninAllowed() const;
const char* SigninAllowedPreferenceName() const;
...
};
Option 2. would correspond to an API looking like:
class IdentityManager {
bool IsSigninAllowed() const;
void SetSigninAllowed(bool signin_allowed);
...
};
,
Sep 27
,
Sep 27
,
Sep 27
See also https://bugs.chromium.org/p/chromium/issues/detail?id=889903 for similar API for signing out that already has setter in SigninManager and that is handled in the embedder.
,
Oct 1
,
Oct 1
,
Oct 1
,
Oct 1
,
Oct 1
,
Oct 1
,
Oct 1
,
Oct 1
,
Oct 1
,
Oct 1
,
Oct 4
,
Oct 4
,
Oct 8
@sdefresne: Are you planning to work on this one yourself anytime soon? Seems to be blocking quite a few other tasks, and I was wondering whether it would make sense for me to work on this one, or if you'd rather do it yourself (and the lack of a Proj-Servicification-VendorBug tag makes me think of the later).
,
Oct 8
I am currently working on a design for refactoring those APIs. I understand that this is blocking many migration bugs, and thus it is one of my highest priority bug.
,
Oct 9
> I am currently working on a design for refactoring those APIs. I understand that this is blocking many migration bugs, and thus it is one of my highest priority bug. Thanks @sdefresne for the heads-up. Looking forward to the new APIs!
,
Oct 12
After discussing this offline with msarda@, the plan is to move the preference out of SigninManager and to leave the responsibility to the embedder. So we would end up with SetSigninAllowed() only API that would be invoked by an object created by the factory.
So all code in chrome/ should be converted away from SigninManagerBase::IsSigninAllowed() and instead directly use the preference.
So converting the following:
bool is_signin_allowed =
SigninManagerFactory::GetForProfile(profile)->IsSigninAllowed()
to:
bool is_signin_allowed =
profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed);
,
Oct 15
Hey Sylvain, Can you expand on what "fixed" means here? Does it mean that all the blocked bugs can now be converted away from using SigninManager at all via the approach described in c#20? Is there any further work to do on the IdentityManager side? Thanks!
,
Oct 15
It means that the blocked bug can now be worked on (by converting to use the preference). An API will exists to propagate the bool from the preference to the SigninManager (via PrimaryAccountMutator most likely) and maybe some API to query the value (but more for completeness, using the preference is the recommended way to get to the pref in embedder code).
,
Nov 9
Oh! I haven't seen this until today, thanks!
,
Nov 9
|
||||||||||||||||||
►
Sign in to add a comment |
||||||||||||||||||
Comment 1 by sdefresne@chromium.org
, Sep 27