Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 1306183007: Switch to id-based affiliation determination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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() 1022 user_manager::UserManager::Get()->FindUser(account_id);
1023 ->GetUserAffiliation(account_id.GetUserEmail()) == 1023 if (user->is_affiliated()) {
1024 policy::USER_AFFILIATION_MANAGED) { 1024 CrosSettings::Get()->GetBoolean(
1025 CrosSettings::Get()->GetBoolean( 1025 kAccountsPrefTransferSAMLCookies,
1026 kAccountsPrefTransferSAMLCookies, 1026 &transfer_saml_auth_cookies_on_subsequent_login);
1027 &transfer_saml_auth_cookies_on_subsequent_login); 1027 }
1028 } 1028 }
1029 1029
1030 // Transfers authentication-related data from the profile that was used for 1030 // Transfers authentication-related data from the profile that was used for
1031 // authentication to the user's profile. The proxy authentication state is 1031 // authentication to the user's profile. The proxy authentication state is
1032 // transferred unconditionally. If the user authenticated via an auth 1032 // transferred unconditionally. If the user authenticated via an auth
1033 // extension, authentication cookies and channel IDs will be transferred as 1033 // extension, authentication cookies and channel IDs will be transferred as
1034 // 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,
1035 // 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
1036 // must be merged using /MergeSession instead. Authentication cookies set by 1036 // must be merged using /MergeSession instead. Authentication cookies set by
1037 // 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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 first_run::GoodiesDisplayer::Delete(); 1761 first_run::GoodiesDisplayer::Delete();
1762 } 1762 }
1763 1763
1764 void UserSessionManager::CreateTokenUtilIfMissing() { 1764 void UserSessionManager::CreateTokenUtilIfMissing() {
1765 if (!token_handle_util_.get()) 1765 if (!token_handle_util_.get())
1766 token_handle_util_.reset( 1766 token_handle_util_.reset(
1767 new TokenHandleUtil(user_manager::UserManager::Get())); 1767 new TokenHandleUtil(user_manager::UserManager::Get()));
1768 } 1768 }
1769 1769
1770 } // namespace chromeos 1770 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698