| Index: chrome/browser/signin/signin_manager_base.h
|
| diff --git a/chrome/browser/signin/signin_manager_base.h b/chrome/browser/signin/signin_manager_base.h
|
| index b10e90f5de44b42d044734ce395e52f89cc2c048..0ebd6907ff50249e7968bb8286f1396742015a75 100644
|
| --- a/chrome/browser/signin/signin_manager_base.h
|
| +++ b/chrome/browser/signin/signin_manager_base.h
|
| @@ -62,28 +62,20 @@ struct GoogleServiceSignoutDetails {
|
|
|
| class SigninManagerBase : public ProfileKeyedService {
|
| public:
|
| - // Returns true if the username is allowed based on the policy string.
|
| - static bool IsAllowedUsername(const std::string& username,
|
| - const std::string& policy);
|
| -
|
| SigninManagerBase();
|
| virtual ~SigninManagerBase();
|
|
|
| // If user was signed in, load tokens from DB if available.
|
| - void Initialize(Profile* profile);
|
| + virtual void Initialize(Profile* profile);
|
| bool IsInitialized() const;
|
|
|
| - // Returns true if the passed username is allowed by policy. Virtual for
|
| - // mocking in tests.
|
| - virtual bool IsAllowedUsername(const std::string& username) const;
|
| -
|
| // Returns true if a signin to Chrome is allowed (by policy or pref).
|
| - bool IsSigninAllowed() const;
|
| -
|
| - // Checks if signin is allowed for the profile that owns |io_data|. This must
|
| - // be invoked on the IO thread, and can be used to check if signin is enabled
|
| - // on that thread.
|
| - static bool IsSigninAllowedOnIOThread(ProfileIOData* io_data);
|
| + // TODO(tim): kSigninAllowed is defined for all platforms in pref_names.h.
|
| + // If kSigninAllowed pref was non-Chrome OS-only, this method wouldn't be
|
| + // needed, but as is we provide this method to let all interested code
|
| + // code query the value in one way, versus half using PrefService directly
|
| + // and the other half using SigninManager.
|
| + virtual bool IsSigninAllowed() const;
|
|
|
| // If a user has previously established a username and SignOut has not been
|
| // called, this will return the username.
|
| @@ -96,12 +88,6 @@ class SigninManagerBase : public ProfileKeyedService {
|
| // (by platform / depending on StartBehavior). Bug 88109.
|
| void SetAuthenticatedUsername(const std::string& username);
|
|
|
| - // Sign a user out, removing the preference, erasing all keys
|
| - // associated with the user, and canceling all auth in progress.
|
| - // TODO(tim): Remove SignOut here, it belongs in the derived class.
|
| - // Bug 174927.
|
| - virtual void SignOut();
|
| -
|
| // Returns true if there's a signin in progress.
|
| virtual bool AuthInProgress() const;
|
|
|
| @@ -126,6 +112,11 @@ class SigninManagerBase : public ProfileKeyedService {
|
| // Lets different platforms initialize TokenService in their own way.
|
| virtual void InitTokenService();
|
|
|
| + // Used by subclass to clear authenticated_username_ instead of using
|
| + // SetAuthenticatedUsername, which enforces special preconditions due
|
| + // to the fact that it is part of the public API and called by clients.
|
| + void clear_authenticated_username();
|
| +
|
| // Pointer to parent profile (protected so FakeSigninManager can access
|
| // it).
|
| Profile* profile_;
|
| @@ -146,16 +137,6 @@ class SigninManagerBase : public ProfileKeyedService {
|
| private:
|
| friend class FakeSigninManagerBase;
|
| friend class FakeSigninManager;
|
| - void OnGoogleServicesUsernamePatternChanged();
|
| -
|
| - void OnSigninAllowedPrefChanged();
|
| -
|
| - // Helper object to listen for changes to signin preferences stored in non-
|
| - // profile-specific local prefs (like kGoogleServicesUsernamePattern).
|
| - PrefChangeRegistrar local_state_pref_registrar_;
|
| -
|
| - // Helper object to listen for changes to the signin allowed preference.
|
| - BooleanPrefMember signin_allowed_;
|
|
|
| // Actual username after successful authentication.
|
| std::string authenticated_username_;
|
|
|