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 26 matching lines...) Expand all Loading... |
37 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 37 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
38 #include "chrome/browser/chromeos/login/user_flow.h" | 38 #include "chrome/browser/chromeos/login/user_flow.h" |
39 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 39 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
40 #include "chrome/browser/chromeos/login/wizard_controller.h" | 40 #include "chrome/browser/chromeos/login/wizard_controller.h" |
41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
42 #include "chrome/browser/chromeos/policy/device_local_account.h" | 42 #include "chrome/browser/chromeos/policy/device_local_account.h" |
43 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 43 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
44 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 44 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
45 #include "chrome/browser/chromeos/settings/cros_settings.h" | 45 #include "chrome/browser/chromeos/settings/cros_settings.h" |
46 #include "chrome/browser/chromeos/system/device_disabling_manager.h" | 46 #include "chrome/browser/chromeos/system/device_disabling_manager.h" |
| 47 #include "chrome/browser/signin/chrome_signin_client.h" |
47 #include "chrome/browser/signin/easy_unlock_service.h" | 48 #include "chrome/browser/signin/easy_unlock_service.h" |
48 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" | 49 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" |
49 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 50 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
50 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
51 #include "chrome/common/chrome_version_info.h" | 52 #include "chrome/common/chrome_version_info.h" |
52 #include "chrome/common/url_constants.h" | 53 #include "chrome/common/url_constants.h" |
53 #include "chrome/grit/generated_resources.h" | 54 #include "chrome/grit/generated_resources.h" |
54 #include "chromeos/chromeos_switches.h" | 55 #include "chromeos/chromeos_switches.h" |
55 #include "chromeos/dbus/dbus_thread_manager.h" | 56 #include "chromeos/dbus/dbus_thread_manager.h" |
56 #include "chromeos/dbus/power_manager_client.h" | 57 #include "chromeos/dbus/power_manager_client.h" |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 | 1113 |
1113 // Re-enable clicking on other windows and the status area. Do not start the | 1114 // Re-enable clicking on other windows and the status area. Do not start the |
1114 // auto-login timer though. On a disabled device, no auto-login can succeed. | 1115 // auto-login timer though. On a disabled device, no auto-login can succeed. |
1115 login_display_->SetUIEnabled(true); | 1116 login_display_->SetUIEnabled(true); |
1116 return; | 1117 return; |
1117 } | 1118 } |
1118 | 1119 |
1119 continuation.Run(); | 1120 continuation.Run(); |
1120 } | 1121 } |
1121 | 1122 |
1122 void ExistingUserController::DoCompleteLogin(const UserContext& user_context) { | 1123 void ExistingUserController::DoCompleteLogin( |
| 1124 const UserContext& user_context_wo_device_id) { |
| 1125 UserContext user_context = user_context_wo_device_id; |
| 1126 std::string device_id = |
| 1127 user_manager::UserManager::Get()->GetKnownUserDeviceId( |
| 1128 user_context.GetUserID()); |
| 1129 if (device_id.empty()) { |
| 1130 bool is_ephemeral = |
| 1131 ChromeUserManager::Get()->AreEphemeralUsersEnabled() && |
| 1132 user_context.GetUserID() != ChromeUserManager::Get()->GetOwnerEmail(); |
| 1133 device_id = ChromeSigninClient::GenerateSigninScopedDeviceID(is_ephemeral); |
| 1134 } |
| 1135 user_context.SetDeviceId(device_id); |
| 1136 |
1123 PerformPreLoginActions(user_context); | 1137 PerformPreLoginActions(user_context); |
1124 | 1138 |
1125 if (!time_init_.is_null()) { | 1139 if (!time_init_.is_null()) { |
1126 base::TimeDelta delta = base::Time::Now() - time_init_; | 1140 base::TimeDelta delta = base::Time::Now() - time_init_; |
1127 UMA_HISTOGRAM_MEDIUM_TIMES("Login.PromptToCompleteLoginTime", delta); | 1141 UMA_HISTOGRAM_MEDIUM_TIMES("Login.PromptToCompleteLoginTime", delta); |
1128 time_init_ = base::Time(); // Reset to null. | 1142 time_init_ = base::Time(); // Reset to null. |
1129 } | 1143 } |
1130 | 1144 |
1131 host_->OnCompleteLogin(); | 1145 host_->OnCompleteLogin(); |
1132 | 1146 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 void ExistingUserController::OnTokenHandleObtained( | 1268 void ExistingUserController::OnTokenHandleObtained( |
1255 const user_manager::UserID& id, | 1269 const user_manager::UserID& id, |
1256 TokenHandleUtil::TokenHandleStatus status) { | 1270 TokenHandleUtil::TokenHandleStatus status) { |
1257 if (status != TokenHandleUtil::VALID) { | 1271 if (status != TokenHandleUtil::VALID) { |
1258 LOG(ERROR) << "OAuth2 token handle fetch failed."; | 1272 LOG(ERROR) << "OAuth2 token handle fetch failed."; |
1259 return; | 1273 return; |
1260 } | 1274 } |
1261 } | 1275 } |
1262 | 1276 |
1263 } // namespace chromeos | 1277 } // namespace chromeos |
OLD | NEW |