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/parallel_authenticator.h" | 5 #include "chrome/browser/chromeos/login/auth/parallel_authenticator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/chromeos/boot_times_loader.h" | 12 #include "chrome/browser/chromeos/boot_times_loader.h" |
13 #include "chrome/browser/chromeos/login/auth/authentication_notification_details
.h" | 13 #include "chrome/browser/chromeos/login/auth/authentication_notification_details
.h" |
14 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
15 #include "chrome/browser/chromeos/ownership/owner_settings_service.h" | 14 #include "chrome/browser/chromeos/ownership/owner_settings_service.h" |
16 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h" | 15 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h" |
17 #include "chrome/browser/chromeos/settings/cros_settings.h" | 16 #include "chrome/browser/chromeos/settings/cros_settings.h" |
18 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
19 #include "chromeos/cryptohome/async_method_caller.h" | 18 #include "chromeos/cryptohome/async_method_caller.h" |
20 #include "chromeos/cryptohome/system_salt_getter.h" | 19 #include "chromeos/cryptohome/system_salt_getter.h" |
21 #include "chromeos/dbus/cryptohome_client.h" | 20 #include "chromeos/dbus/cryptohome_client.h" |
22 #include "chromeos/dbus/dbus_thread_manager.h" | 21 #include "chromeos/dbus/dbus_thread_manager.h" |
23 #include "chromeos/login/auth/auth_status_consumer.h" | 22 #include "chromeos/login/auth/auth_status_consumer.h" |
24 #include "chromeos/login/auth/key.h" | 23 #include "chromeos/login/auth/key.h" |
25 #include "chromeos/login/auth/user_context.h" | 24 #include "chromeos/login/auth/user_context.h" |
26 #include "chromeos/login/login_state.h" | 25 #include "chromeos/login/login_state.h" |
27 #include "chromeos/login/user_names.h" | 26 #include "chromeos/login/user_names.h" |
| 27 #include "components/user_manager/user_manager.h" |
28 #include "components/user_manager/user_type.h" | 28 #include "components/user_manager/user_type.h" |
29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
31 #include "third_party/cros_system_api/dbus/service_constants.h" | 31 #include "third_party/cros_system_api/dbus/service_constants.h" |
32 | 32 |
33 using content::BrowserThread; | 33 using content::BrowserThread; |
34 | 34 |
35 namespace chromeos { | 35 namespace chromeos { |
36 | 36 |
37 namespace { | 37 namespace { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 owner_is_verified_(false), | 235 owner_is_verified_(false), |
236 user_can_login_(false), | 236 user_can_login_(false), |
237 remove_user_data_on_failure_(false), | 237 remove_user_data_on_failure_(false), |
238 delayed_login_failure_(NULL) { | 238 delayed_login_failure_(NULL) { |
239 } | 239 } |
240 | 240 |
241 void ParallelAuthenticator::AuthenticateToLogin( | 241 void ParallelAuthenticator::AuthenticateToLogin( |
242 Profile* profile, | 242 Profile* profile, |
243 const UserContext& user_context) { | 243 const UserContext& user_context) { |
244 authentication_profile_ = profile; | 244 authentication_profile_ = profile; |
245 current_state_.reset(new AuthAttemptState( | 245 current_state_.reset( |
246 user_context, | 246 new AuthAttemptState(user_context, |
247 user_manager::USER_TYPE_REGULAR, | 247 user_manager::USER_TYPE_REGULAR, |
248 false, // unlock | 248 false, // unlock |
249 false, // online_complete | 249 false, // online_complete |
250 !UserManager::Get()->IsKnownUser(user_context.GetUserID()))); | 250 !user_manager::UserManager::Get()->IsKnownUser( |
| 251 user_context.GetUserID()))); |
251 // Reset the verified flag. | 252 // Reset the verified flag. |
252 owner_is_verified_ = false; | 253 owner_is_verified_ = false; |
253 | 254 |
254 SystemSaltGetter::Get()->GetSystemSalt( | 255 SystemSaltGetter::Get()->GetSystemSalt( |
255 base::Bind(&Mount, | 256 base::Bind(&Mount, |
256 current_state_.get(), | 257 current_state_.get(), |
257 scoped_refptr<ParallelAuthenticator>(this), | 258 scoped_refptr<ParallelAuthenticator>(this), |
258 cryptohome::MOUNT_FLAGS_NONE)); | 259 cryptohome::MOUNT_FLAGS_NONE)); |
259 } | 260 } |
260 | 261 |
261 void ParallelAuthenticator::CompleteLogin(Profile* profile, | 262 void ParallelAuthenticator::CompleteLogin(Profile* profile, |
262 const UserContext& user_context) { | 263 const UserContext& user_context) { |
263 authentication_profile_ = profile; | 264 authentication_profile_ = profile; |
264 current_state_.reset(new AuthAttemptState( | 265 current_state_.reset( |
265 user_context, | 266 new AuthAttemptState(user_context, |
266 user_manager::USER_TYPE_REGULAR, | 267 user_manager::USER_TYPE_REGULAR, |
267 true, // unlock | 268 true, // unlock |
268 false, // online_complete | 269 false, // online_complete |
269 !UserManager::Get()->IsKnownUser(user_context.GetUserID()))); | 270 !user_manager::UserManager::Get()->IsKnownUser( |
| 271 user_context.GetUserID()))); |
270 | 272 |
271 // Reset the verified flag. | 273 // Reset the verified flag. |
272 owner_is_verified_ = false; | 274 owner_is_verified_ = false; |
273 | 275 |
274 SystemSaltGetter::Get()->GetSystemSalt( | 276 SystemSaltGetter::Get()->GetSystemSalt( |
275 base::Bind(&Mount, | 277 base::Bind(&Mount, |
276 current_state_.get(), | 278 current_state_.get(), |
277 scoped_refptr<ParallelAuthenticator>(this), | 279 scoped_refptr<ParallelAuthenticator>(this), |
278 cryptohome::MOUNT_FLAGS_NONE)); | 280 cryptohome::MOUNT_FLAGS_NONE)); |
279 | 281 |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 Resolve(); | 834 Resolve(); |
833 } | 835 } |
834 | 836 |
835 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, | 837 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, |
836 bool check_result) { | 838 bool check_result) { |
837 owner_is_verified_ = owner_check_finished; | 839 owner_is_verified_ = owner_check_finished; |
838 user_can_login_ = check_result; | 840 user_can_login_ = check_result; |
839 } | 841 } |
840 | 842 |
841 } // namespace chromeos | 843 } // namespace chromeos |
OLD | NEW |