| 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 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 BootTimesRecorder* btl = BootTimesRecorder::Get(); | 1012 BootTimesRecorder* btl = BootTimesRecorder::Get(); |
| 1013 btl->AddLoginTimeMarker("UserProfileGotten", false); | 1013 btl->AddLoginTimeMarker("UserProfileGotten", false); |
| 1014 | 1014 |
| 1015 if (user_context_.IsUsingOAuth()) { | 1015 if (user_context_.IsUsingOAuth()) { |
| 1016 // Retrieve the policy that indicates whether to continue copying | 1016 // Retrieve the policy that indicates whether to continue copying |
| 1017 // authentication cookies set by a SAML IdP on subsequent logins after the | 1017 // authentication cookies set by a SAML IdP on subsequent logins after the |
| 1018 // first. | 1018 // first. |
| 1019 bool transfer_saml_auth_cookies_on_subsequent_login = false; | 1019 bool transfer_saml_auth_cookies_on_subsequent_login = false; |
| 1020 if (has_auth_cookies_ && | 1020 if (has_auth_cookies_) { |
| 1021 g_browser_process->platform_part()-> | 1021 const user_manager::User* user = |
| 1022 browser_policy_connector_chromeos()->GetUserAffiliation(user_id) == | 1022 user_manager::UserManager::Get()->FindUser(user_id); |
| 1023 policy::USER_AFFILIATION_MANAGED) { | 1023 if (user->is_affiliated()) { |
| 1024 CrosSettings::Get()->GetBoolean( | 1024 CrosSettings::Get()->GetBoolean( |
| 1025 kAccountsPrefTransferSAMLCookies, | 1025 kAccountsPrefTransferSAMLCookies, |
| 1026 &transfer_saml_auth_cookies_on_subsequent_login); | 1026 &transfer_saml_auth_cookies_on_subsequent_login); |
| 1027 } |
| 1027 } | 1028 } |
| 1028 | 1029 |
| 1029 // Transfers authentication-related data from the profile that was used for | 1030 // Transfers authentication-related data from the profile that was used for |
| 1030 // authentication to the user's profile. The proxy authentication state is | 1031 // authentication to the user's profile. The proxy authentication state is |
| 1031 // transferred unconditionally. If the user authenticated via an auth | 1032 // transferred unconditionally. If the user authenticated via an auth |
| 1032 // extension, authentication cookies and channel IDs will be transferred as | 1033 // extension, authentication cookies and channel IDs will be transferred as |
| 1033 // well when the user's cookie jar is empty. If the cookie jar is not empty, | 1034 // well when the user's cookie jar is empty. If the cookie jar is not empty, |
| 1034 // the authentication states in the browser context and the user's profile | 1035 // the authentication states in the browser context and the user's profile |
| 1035 // must be merged using /MergeSession instead. Authentication cookies set by | 1036 // must be merged using /MergeSession instead. Authentication cookies set by |
| 1036 // a SAML IdP will also be transferred when the user's cookie jar is not | 1037 // a SAML IdP will also be transferred when the user's cookie jar is not |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 token_handle_util_.reset(); | 1757 token_handle_util_.reset(); |
| 1757 } | 1758 } |
| 1758 | 1759 |
| 1759 void UserSessionManager::CreateTokenUtilIfMissing() { | 1760 void UserSessionManager::CreateTokenUtilIfMissing() { |
| 1760 if (!token_handle_util_.get()) | 1761 if (!token_handle_util_.get()) |
| 1761 token_handle_util_.reset( | 1762 token_handle_util_.reset( |
| 1762 new TokenHandleUtil(user_manager::UserManager::Get())); | 1763 new TokenHandleUtil(user_manager::UserManager::Get())); |
| 1763 } | 1764 } |
| 1764 | 1765 |
| 1765 } // namespace chromeos | 1766 } // namespace chromeos |
| OLD | NEW |