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 #include "chrome/browser/chromeos/login/login_performer.h" | 5 #include "chrome/browser/chromeos/login/login_performer.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 BrowserThread::PostTask( | 296 BrowserThread::PostTask( |
297 BrowserThread::UI, FROM_HERE, | 297 BrowserThread::UI, FROM_HERE, |
298 base::Bind(&Authenticator::LoginOffTheRecord, authenticator_.get())); | 298 base::Bind(&Authenticator::LoginOffTheRecord, authenticator_.get())); |
299 } | 299 } |
300 | 300 |
301 void LoginPerformer::LoginAsPublicAccount(const std::string& username) { | 301 void LoginPerformer::LoginAsPublicAccount(const std::string& username) { |
302 // Login is not allowed if policy could not be loaded for the account. | 302 // Login is not allowed if policy could not be loaded for the account. |
303 policy::DeviceLocalAccountPolicyService* policy_service = | 303 policy::DeviceLocalAccountPolicyService* policy_service = |
304 g_browser_process->browser_policy_connector()-> | 304 g_browser_process->browser_policy_connector()-> |
305 GetDeviceLocalAccountPolicyService(); | 305 GetDeviceLocalAccountPolicyService(); |
306 if (!policy_service || | 306 if (!policy_service || !policy_service->IsPolicyAvailableForUser(username)) { |
307 !policy_service->IsPolicyAvailableForAccount(username)) { | |
308 DCHECK(delegate_); | 307 DCHECK(delegate_); |
309 if (delegate_) | 308 if (delegate_) |
310 delegate_->PolicyLoadFailed(); | 309 delegate_->PolicyLoadFailed(); |
311 return; | 310 return; |
312 } | 311 } |
313 | 312 |
314 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); | 313 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); |
315 BrowserThread::PostTask( | 314 BrowserThread::PostTask( |
316 BrowserThread::UI, FROM_HERE, | 315 BrowserThread::UI, FROM_HERE, |
317 base::Bind(&Authenticator::LoginAsPublicAccount, authenticator_.get(), | 316 base::Bind(&Authenticator::LoginAsPublicAccount, authenticator_.get(), |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 profile, | 519 profile, |
521 user_context_, | 520 user_context_, |
522 std::string(), | 521 std::string(), |
523 std::string())); | 522 std::string())); |
524 } | 523 } |
525 user_context_.password.clear(); | 524 user_context_.password.clear(); |
526 user_context_.auth_code.clear(); | 525 user_context_.auth_code.clear(); |
527 } | 526 } |
528 | 527 |
529 } // namespace chromeos | 528 } // namespace chromeos |
OLD | NEW |