Random thoughts about these APIs.
HasPrimaryAccountInfo is implemted as
bool IdentityManager::HasPrimaryAccount() const {
return !primary_account_info_.account_id.empty();
}
But AccountInfo has a first-calls IsEmpty() method. Should we use that instead?
My other thought is, we might make this more self documenting by changing GetPrimaryAccountInfo() to return a base::Optional<AccountInfo>. All calls to HasPrimaryAccount() could be replaced with GetPrimaryAccountInfo().has_value() (or even better, you can just drop the has_value() since base::Optional implements the bool operator).
Chris