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/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 user_manager::UserManager::Get()->GetKnownUserDeviceId( | 1127 user_manager::UserManager::Get()->GetKnownUserDeviceId( |
1128 user_context.GetUserID()); | 1128 user_context.GetUserID()); |
1129 if (device_id.empty()) { | 1129 if (device_id.empty()) { |
1130 bool is_ephemeral = | 1130 bool is_ephemeral = |
1131 ChromeUserManager::Get()->AreEphemeralUsersEnabled() && | 1131 ChromeUserManager::Get()->AreEphemeralUsersEnabled() && |
1132 user_context.GetUserID() != ChromeUserManager::Get()->GetOwnerEmail(); | 1132 user_context.GetUserID() != ChromeUserManager::Get()->GetOwnerEmail(); |
1133 device_id = ChromeSigninClient::GenerateSigninScopedDeviceID(is_ephemeral); | 1133 device_id = ChromeSigninClient::GenerateSigninScopedDeviceID(is_ephemeral); |
1134 } | 1134 } |
1135 user_context.SetDeviceId(device_id); | 1135 user_context.SetDeviceId(device_id); |
1136 | 1136 |
| 1137 const std::string& gaps_cookie = user_context.GetGAPSCookie(); |
| 1138 if (!gaps_cookie.empty()) { |
| 1139 user_manager::UserManager::Get()->SetKnownUserGAPSCookie( |
| 1140 user_context.GetUserID(), gaps_cookie); |
| 1141 } |
| 1142 |
1137 PerformPreLoginActions(user_context); | 1143 PerformPreLoginActions(user_context); |
1138 | 1144 |
1139 if (!time_init_.is_null()) { | 1145 if (!time_init_.is_null()) { |
1140 base::TimeDelta delta = base::Time::Now() - time_init_; | 1146 base::TimeDelta delta = base::Time::Now() - time_init_; |
1141 UMA_HISTOGRAM_MEDIUM_TIMES("Login.PromptToCompleteLoginTime", delta); | 1147 UMA_HISTOGRAM_MEDIUM_TIMES("Login.PromptToCompleteLoginTime", delta); |
1142 time_init_ = base::Time(); // Reset to null. | 1148 time_init_ = base::Time(); // Reset to null. |
1143 } | 1149 } |
1144 | 1150 |
1145 host_->OnCompleteLogin(); | 1151 host_->OnCompleteLogin(); |
1146 | 1152 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 if (!success) { | 1254 if (!success) { |
1249 LOG(ERROR) << "OAuth2 token fetch failed."; | 1255 LOG(ERROR) << "OAuth2 token fetch failed."; |
1250 OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN)); | 1256 OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN)); |
1251 return; | 1257 return; |
1252 } | 1258 } |
1253 UserSessionManager::GetInstance()->OnOAuth2TokensFetched(user_context); | 1259 UserSessionManager::GetInstance()->OnOAuth2TokensFetched(user_context); |
1254 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); | 1260 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); |
1255 } | 1261 } |
1256 | 1262 |
1257 } // namespace chromeos | 1263 } // namespace chromeos |
OLD | NEW |