| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> |
| 9 #include <set> | 10 #include <set> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/base_paths.h" | 14 #include "base/base_paths.h" |
| 14 #include "base/bind.h" | 15 #include "base/bind.h" |
| 15 #include "base/callback_helpers.h" | 16 #include "base/callback_helpers.h" |
| 16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 17 #include "base/location.h" | 18 #include "base/location.h" |
| 18 #include "base/logging.h" | 19 #include "base/logging.h" |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 DCHECK(!gaia_id.empty()); | 1088 DCHECK(!gaia_id.empty()); |
| 1088 } | 1089 } |
| 1089 | 1090 |
| 1090 // Make sure that the google service username is properly set (we do this | 1091 // Make sure that the google service username is properly set (we do this |
| 1091 // on every sign in, not just the first login, to deal with existing | 1092 // on every sign in, not just the first login, to deal with existing |
| 1092 // profiles that might not have it set yet). | 1093 // profiles that might not have it set yet). |
| 1093 SigninManagerBase* signin_manager = | 1094 SigninManagerBase* signin_manager = |
| 1094 SigninManagerFactory::GetForProfile(profile); | 1095 SigninManagerFactory::GetForProfile(profile); |
| 1095 signin_manager->SetAuthenticatedAccountInfo( | 1096 signin_manager->SetAuthenticatedAccountInfo( |
| 1096 gaia_id, user_context.GetAccountId().GetUserEmail()); | 1097 gaia_id, user_context.GetAccountId().GetUserEmail()); |
| 1098 VLOG(1) << "Seed SigninManagerBase with the authenticated account info" |
| 1099 << ", success=" << signin_manager->IsAuthenticated(); |
| 1097 | 1100 |
| 1098 // Backfill GAIA ID in user prefs stored in Local State. | 1101 // Backfill GAIA ID in user prefs stored in Local State. |
| 1099 std::string tmp_gaia_id; | 1102 std::string tmp_gaia_id; |
| 1100 if (!user_manager::known_user::FindGaiaID(user_context.GetAccountId(), | 1103 if (!user_manager::known_user::FindGaiaID(user_context.GetAccountId(), |
| 1101 &tmp_gaia_id) && | 1104 &tmp_gaia_id) && |
| 1102 !gaia_id.empty()) { | 1105 !gaia_id.empty()) { |
| 1103 user_manager::known_user::UpdateGaiaID(user_context.GetAccountId(), | 1106 user_manager::known_user::UpdateGaiaID(user_context.GetAccountId(), |
| 1104 gaia_id); | 1107 gaia_id); |
| 1105 } | 1108 } |
| 1106 } | 1109 } |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 ->browser_policy_connector_chromeos() | 1970 ->browser_policy_connector_chromeos() |
| 1968 ->IsEnterpriseManaged()) { | 1971 ->IsEnterpriseManaged()) { |
| 1969 return false; | 1972 return false; |
| 1970 } | 1973 } |
| 1971 | 1974 |
| 1972 // Do not show end of life notification if this is a guest session | 1975 // Do not show end of life notification if this is a guest session |
| 1973 return !profile->IsGuestSession(); | 1976 return !profile->IsGuestSession(); |
| 1974 } | 1977 } |
| 1975 | 1978 |
| 1976 } // namespace chromeos | 1979 } // namespace chromeos |
| OLD | NEW |