| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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. When a user is signed in, a ClientLogin | 6 // which user is signed in. When a user is signed in, a ClientLogin |
| 7 // request is run on their behalf. Auth tokens are fetched from Google | 7 // request is run on their behalf. Auth tokens are fetched from Google |
| 8 // and the results are stored in the TokenService. | 8 // and the results are stored in the TokenService. |
| 9 // | 9 // |
| 10 // **NOTE** on semantics of SigninManager: | 10 // **NOTE** on semantics of SigninManager: |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 return signin_global_error_.get(); | 181 return signin_global_error_.get(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 const SigninGlobalError* signin_global_error() const { | 184 const SigninGlobalError* signin_global_error() const { |
| 185 return signin_global_error_.get(); | 185 return signin_global_error_.get(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 // ProfileKeyedService implementation. | 188 // ProfileKeyedService implementation. |
| 189 virtual void Shutdown() OVERRIDE; | 189 virtual void Shutdown() OVERRIDE; |
| 190 | 190 |
| 191 // Tells the SigninManager to prohibit signout for this profile. |
| 192 void ProhibitSignout(); |
| 193 |
| 194 // If true, signout is prohibited for this profile (calls to SignOut() are |
| 195 // ignored). |
| 196 bool IsSignoutProhibited() const; |
| 197 |
| 191 protected: | 198 protected: |
| 192 // Weak pointer to parent profile (protected so FakeSigninManager can access | 199 // Weak pointer to parent profile (protected so FakeSigninManager can access |
| 193 // it). | 200 // it). |
| 194 Profile* profile_; | 201 Profile* profile_; |
| 195 | 202 |
| 196 // Used to show auth errors in the wrench menu. The SigninGlobalError is | 203 // Used to show auth errors in the wrench menu. The SigninGlobalError is |
| 197 // different than most GlobalErrors in that its lifetime is controlled by | 204 // different than most GlobalErrors in that its lifetime is controlled by |
| 198 // SigninManager (so we can expose a reference for use in the wrench menu). | 205 // SigninManager (so we can expose a reference for use in the wrench menu). |
| 199 scoped_ptr<SigninGlobalError> signin_global_error_; | 206 scoped_ptr<SigninGlobalError> signin_global_error_; |
| 200 | 207 |
| 208 // Flag saying whether signing out is allowed. |
| 209 bool prohibit_signout_; |
| 210 |
| 201 private: | 211 private: |
| 202 enum SigninType { | 212 enum SigninType { |
| 203 SIGNIN_TYPE_NONE, | 213 SIGNIN_TYPE_NONE, |
| 204 SIGNIN_TYPE_CLIENT_LOGIN, | 214 SIGNIN_TYPE_CLIENT_LOGIN, |
| 205 SIGNIN_TYPE_WITH_CREDENTIALS, | 215 SIGNIN_TYPE_WITH_CREDENTIALS, |
| 206 SIGNIN_TYPE_CLIENT_OAUTH, | 216 SIGNIN_TYPE_CLIENT_OAUTH, |
| 207 }; | 217 }; |
| 208 | 218 |
| 209 std::string SigninTypeToString(SigninType type); | 219 std::string SigninTypeToString(SigninType type); |
| 210 | 220 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) | 335 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) |
| 326 // CloudPolicyClient reference we keep while determining whether to create | 336 // CloudPolicyClient reference we keep while determining whether to create |
| 327 // a new profile for an enterprise user or not. | 337 // a new profile for an enterprise user or not. |
| 328 scoped_ptr<policy::CloudPolicyClient> policy_client_; | 338 scoped_ptr<policy::CloudPolicyClient> policy_client_; |
| 329 #endif | 339 #endif |
| 330 | 340 |
| 331 DISALLOW_COPY_AND_ASSIGN(SigninManager); | 341 DISALLOW_COPY_AND_ASSIGN(SigninManager); |
| 332 }; | 342 }; |
| 333 | 343 |
| 334 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ | 344 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ |
| OLD | NEW |