| 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/auth/login_performer.h" | 5 #include "chrome/browser/chromeos/login/auth/login_performer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
| 16 #include "chrome/browser/chromeos/boot_times_loader.h" | 16 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 17 #include "chrome/browser/chromeos/login/login_utils.h" | 17 #include "chrome/browser/chromeos/login/login_utils.h" |
| 18 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" | 18 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" |
| 19 #include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h" | 19 #include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h" |
| 20 #include "chrome/browser/chromeos/login/supervised/supervised_user_login_flow.h" | 20 #include "chrome/browser/chromeos/login/supervised/supervised_user_login_flow.h" |
| 21 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 21 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 22 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
| 22 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
| 23 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 23 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 24 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 24 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 25 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 25 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 26 #include "chrome/browser/chromeos/settings/cros_settings.h" | 26 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chromeos/dbus/dbus_thread_manager.h" | 28 #include "chromeos/dbus/dbus_thread_manager.h" |
| 29 #include "chromeos/dbus/session_manager_client.h" | 29 #include "chromeos/dbus/session_manager_client.h" |
| 30 #include "chromeos/login/user_names.h" | 30 #include "chromeos/login/user_names.h" |
| 31 #include "chromeos/settings/cros_settings_names.h" | 31 #include "chromeos/settings/cros_settings_names.h" |
| 32 #include "components/user_manager/user_manager.h" |
| 32 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
| 33 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
| 34 #include "content/public/browser/notification_types.h" | 35 #include "content/public/browser/notification_types.h" |
| 35 #include "content/public/browser/user_metrics.h" | 36 #include "content/public/browser/user_metrics.h" |
| 36 #include "google_apis/gaia/gaia_auth_util.h" | 37 #include "google_apis/gaia/gaia_auth_util.h" |
| 37 #include "net/cookies/cookie_monster.h" | 38 #include "net/cookies/cookie_monster.h" |
| 38 #include "net/cookies/cookie_store.h" | 39 #include "net/cookies/cookie_store.h" |
| 39 #include "net/url_request/url_request_context.h" | 40 #include "net/url_request/url_request_context.h" |
| 40 #include "net/url_request/url_request_context_getter.h" | 41 #include "net/url_request/url_request_context_getter.h" |
| 41 | 42 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 delegate_->PolicyLoadFailed(); | 213 delegate_->PolicyLoadFailed(); |
| 213 else | 214 else |
| 214 NOTREACHED(); | 215 NOTREACHED(); |
| 215 return; | 216 return; |
| 216 } else if (status != CrosSettingsProvider::TRUSTED) { | 217 } else if (status != CrosSettingsProvider::TRUSTED) { |
| 217 // Value of kAccountsPrefSupervisedUsersEnabled setting is still not | 218 // Value of kAccountsPrefSupervisedUsersEnabled setting is still not |
| 218 // verified. Another attempt will be invoked after verification completion. | 219 // verified. Another attempt will be invoked after verification completion. |
| 219 return; | 220 return; |
| 220 } | 221 } |
| 221 | 222 |
| 222 if (!UserManager::Get()->AreSupervisedUsersAllowed()) { | 223 if (!user_manager::UserManager::Get()->AreSupervisedUsersAllowed()) { |
| 223 LOG(ERROR) << "Login attempt of supervised user detected."; | 224 LOG(ERROR) << "Login attempt of supervised user detected."; |
| 224 delegate_->WhiteListCheckFailed(user_context.GetUserID()); | 225 delegate_->WhiteListCheckFailed(user_context.GetUserID()); |
| 225 return; | 226 return; |
| 226 } | 227 } |
| 227 | 228 |
| 228 SupervisedUserLoginFlow* new_flow = | 229 SupervisedUserLoginFlow* new_flow = |
| 229 new SupervisedUserLoginFlow(user_context.GetUserID()); | 230 new SupervisedUserLoginFlow(user_context.GetUserID()); |
| 230 new_flow->set_host( | 231 new_flow->set_host( |
| 231 UserManager::Get()->GetUserFlow(user_context.GetUserID())->host()); | 232 ChromeUserManager::Get()->GetUserFlow(user_context.GetUserID())->host()); |
| 232 UserManager::Get()->SetUserFlow(user_context.GetUserID(), new_flow); | 233 ChromeUserManager::Get()->SetUserFlow(user_context.GetUserID(), new_flow); |
| 233 | 234 |
| 234 SupervisedUserAuthentication* authentication = UserManager::Get()-> | 235 SupervisedUserAuthentication* authentication = |
| 235 GetSupervisedUserManager()->GetAuthentication(); | 236 ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication(); |
| 236 | 237 |
| 237 UserContext user_context_copy = authentication->TransformKey(user_context); | 238 UserContext user_context_copy = authentication->TransformKey(user_context); |
| 238 | 239 |
| 239 if (authentication->GetPasswordSchema(user_context.GetUserID()) == | 240 if (authentication->GetPasswordSchema(user_context.GetUserID()) == |
| 240 SupervisedUserAuthentication::SCHEMA_SALT_HASHED) { | 241 SupervisedUserAuthentication::SCHEMA_SALT_HASHED) { |
| 241 if (extended_authenticator_.get()) { | 242 if (extended_authenticator_.get()) { |
| 242 extended_authenticator_->SetConsumer(NULL); | 243 extended_authenticator_->SetConsumer(NULL); |
| 243 } | 244 } |
| 244 extended_authenticator_ = new ExtendedAuthenticator(this); | 245 extended_authenticator_ = new ExtendedAuthenticator(this); |
| 245 // TODO(antrim) : Replace empty callback with explicit method. | 246 // TODO(antrim) : Replace empty callback with explicit method. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 policy::WildcardLoginChecker::Result result) { | 363 policy::WildcardLoginChecker::Result result) { |
| 363 if (result == policy::WildcardLoginChecker::RESULT_ALLOWED) { | 364 if (result == policy::WildcardLoginChecker::RESULT_ALLOWED) { |
| 364 StartLoginCompletion(); | 365 StartLoginCompletion(); |
| 365 } else { | 366 } else { |
| 366 if (delegate_) | 367 if (delegate_) |
| 367 delegate_->WhiteListCheckFailed(user_context_.GetUserID()); | 368 delegate_->WhiteListCheckFailed(user_context_.GetUserID()); |
| 368 } | 369 } |
| 369 } | 370 } |
| 370 | 371 |
| 371 } // namespace chromeos | 372 } // namespace chromeos |
| OLD | NEW |