| 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_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 // Update user's displayed email. | 408 // Update user's displayed email. |
| 409 if (!display_email.empty()) | 409 if (!display_email.empty()) |
| 410 user_manager->SaveUserDisplayEmail(user_context.username, display_email); | 410 user_manager->SaveUserDisplayEmail(user_context.username, display_email); |
| 411 | 411 |
| 412 user_context_ = user_context; | 412 user_context_ = user_context; |
| 413 | 413 |
| 414 has_web_auth_cookies_ = has_cookies; | 414 has_web_auth_cookies_ = has_cookies; |
| 415 delegate_ = delegate; | 415 delegate_ = delegate; |
| 416 InitSessionRestoreStrategy(); | 416 InitSessionRestoreStrategy(); |
| 417 | 417 |
| 418 base::FilePath profile_dir; | |
| 419 if (DemoAppLauncher::IsDemoAppSession(user_context.username)) { | 418 if (DemoAppLauncher::IsDemoAppSession(user_context.username)) { |
| 420 g_browser_process->profile_manager()->CreateProfileAsync( | 419 g_browser_process->profile_manager()->CreateProfileAsync( |
| 421 ProfileManager::GetGuestProfilePath(), | 420 user_manager->GetUserProfileDir(user_context.username), |
| 422 base::Bind(&LoginUtilsImpl::OnOTRProfileCreated, AsWeakPtr(), | 421 base::Bind(&LoginUtilsImpl::OnOTRProfileCreated, AsWeakPtr(), |
| 423 user_context.username), | 422 user_context.username), |
| 424 base::string16(), base::string16(), std::string()); | 423 base::string16(), base::string16(), std::string()); |
| 425 } else { | 424 } else { |
| 426 // Can't use display_email because it is empty when existing user logs in | 425 // Can't use display_email because it is empty when existing user logs in |
| 427 // using sing-in pod on login screen (i.e. user didn't type email). | 426 // using sing-in pod on login screen (i.e. user didn't type email). |
| 428 g_browser_process->profile_manager()->CreateProfileAsync( | 427 g_browser_process->profile_manager()->CreateProfileAsync( |
| 429 user_manager->GetUserProfileDir(user_context.username), | 428 user_manager->GetUserProfileDir(user_context.username), |
| 430 base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr(), | 429 base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr(), |
| 431 user_context.username), | 430 user_context.username), |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 CrosSettings* cros_settings = CrosSettings::Get(); | 945 CrosSettings* cros_settings = CrosSettings::Get(); |
| 947 bool allow_new_user = false; | 946 bool allow_new_user = false; |
| 948 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 947 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 949 if (allow_new_user) | 948 if (allow_new_user) |
| 950 return true; | 949 return true; |
| 951 return cros_settings->FindEmailInList( | 950 return cros_settings->FindEmailInList( |
| 952 kAccountsPrefUsers, username, wildcard_match); | 951 kAccountsPrefUsers, username, wildcard_match); |
| 953 } | 952 } |
| 954 | 953 |
| 955 } // namespace chromeos | 954 } // namespace chromeos |
| OLD | NEW |