OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // The signin manager encapsulates some functionality tracking | 5 // The signin manager encapsulates some functionality tracking |
6 // which user is signed in. See SigninManagerBase for full description of | 6 // which user is signed in. See SigninManagerBase for full description of |
7 // responsibilities. The class defined in this file provides functionality | 7 // responsibilities. The class defined in this file provides functionality |
8 // required by all platforms except Chrome OS. | 8 // required by all platforms except Chrome OS. |
9 // | 9 // |
10 // When a user is signed in, a ClientLogin request is run on their behalf. | 10 // When a user is signed in, a ClientLogin request is run on their behalf. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // in-progress credentials to the new profile. | 86 // in-progress credentials to the new profile. |
87 virtual void CopyCredentialsFrom(const SigninManager& source); | 87 virtual void CopyCredentialsFrom(const SigninManager& source); |
88 | 88 |
89 // Sign a user out, removing the preference, erasing all keys | 89 // Sign a user out, removing the preference, erasing all keys |
90 // associated with the user, and canceling all auth in progress. | 90 // associated with the user, and canceling all auth in progress. |
91 virtual void SignOut(signin_metrics::ProfileSignout signout_source_metric); | 91 virtual void SignOut(signin_metrics::ProfileSignout signout_source_metric); |
92 | 92 |
93 // On platforms where SigninManager is responsible for dealing with | 93 // On platforms where SigninManager is responsible for dealing with |
94 // invalid username policy updates, we need to check this during | 94 // invalid username policy updates, we need to check this during |
95 // initialization and sign the user out. | 95 // initialization and sign the user out. |
96 virtual void Initialize(PrefService* local_state) OVERRIDE; | 96 virtual void Initialize(PrefService* local_state) override; |
97 virtual void Shutdown() OVERRIDE; | 97 virtual void Shutdown() override; |
98 | 98 |
99 // Invoked from an OAuthTokenFetchedCallback to complete user signin. | 99 // Invoked from an OAuthTokenFetchedCallback to complete user signin. |
100 virtual void CompletePendingSignin(); | 100 virtual void CompletePendingSignin(); |
101 | 101 |
102 // Invoked from SigninManagerAndroid to indicate that the sign-in process | 102 // Invoked from SigninManagerAndroid to indicate that the sign-in process |
103 // has completed for |username|. | 103 // has completed for |username|. |
104 void OnExternalSigninCompleted(const std::string& username); | 104 void OnExternalSigninCompleted(const std::string& username); |
105 | 105 |
106 // Returns true if there's a signin in progress. | 106 // Returns true if there's a signin in progress. |
107 virtual bool AuthInProgress() const OVERRIDE; | 107 virtual bool AuthInProgress() const override; |
108 | 108 |
109 virtual bool IsSigninAllowed() const OVERRIDE; | 109 virtual bool IsSigninAllowed() const override; |
110 | 110 |
111 // Returns true if the passed username is allowed by policy. Virtual for | 111 // Returns true if the passed username is allowed by policy. Virtual for |
112 // mocking in tests. | 112 // mocking in tests. |
113 virtual bool IsAllowedUsername(const std::string& username) const; | 113 virtual bool IsAllowedUsername(const std::string& username) const; |
114 | 114 |
115 // If an authentication is in progress, return the username being | 115 // If an authentication is in progress, return the username being |
116 // authenticated. Returns an empty string if no auth is in progress. | 116 // authenticated. Returns an empty string if no auth is in progress. |
117 const std::string& GetUsernameForAuthInProgress() const; | 117 const std::string& GetUsernameForAuthInProgress() const; |
118 | 118 |
119 // Set the preference to turn off one-click sign-in so that it won't ever | 119 // Set the preference to turn off one-click sign-in so that it won't ever |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 scoped_ptr<MergeSessionHelper> merge_session_helper_; | 210 scoped_ptr<MergeSessionHelper> merge_session_helper_; |
211 | 211 |
212 base::WeakPtrFactory<SigninManager> weak_pointer_factory_; | 212 base::WeakPtrFactory<SigninManager> weak_pointer_factory_; |
213 | 213 |
214 DISALLOW_COPY_AND_ASSIGN(SigninManager); | 214 DISALLOW_COPY_AND_ASSIGN(SigninManager); |
215 }; | 215 }; |
216 | 216 |
217 #endif // !defined(OS_CHROMEOS) | 217 #endif // !defined(OS_CHROMEOS) |
218 | 218 |
219 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_H_ | 219 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_H_ |
OLD | NEW |