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 "components/user_manager/user_manager_base.h" | 5 #include "components/user_manager/user_manager_base.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 // Do not update local state if data stored or cached outside the user's | 358 // Do not update local state if data stored or cached outside the user's |
359 // cryptohome is to be treated as ephemeral. | 359 // cryptohome is to be treated as ephemeral. |
360 if (IsUserNonCryptohomeDataEphemeral(account_id)) | 360 if (IsUserNonCryptohomeDataEphemeral(account_id)) |
361 return; | 361 return; |
362 | 362 |
363 { | 363 { |
364 DictionaryPrefUpdate oauth_status_update(GetLocalState(), | 364 DictionaryPrefUpdate oauth_status_update(GetLocalState(), |
365 kUserOAuthTokenStatus); | 365 kUserOAuthTokenStatus); |
366 oauth_status_update->SetWithoutPathExpansion( | 366 oauth_status_update->SetWithoutPathExpansion( |
367 account_id.GetUserEmail(), | 367 account_id.GetUserEmail(), |
368 new base::FundamentalValue(static_cast<int>(oauth_token_status))); | 368 new base::Value(static_cast<int>(oauth_token_status))); |
369 } | 369 } |
370 GetLocalState()->CommitPendingWrite(); | 370 GetLocalState()->CommitPendingWrite(); |
371 } | 371 } |
372 | 372 |
373 void UserManagerBase::SaveForceOnlineSignin(const AccountId& account_id, | 373 void UserManagerBase::SaveForceOnlineSignin(const AccountId& account_id, |
374 bool force_online_signin) { | 374 bool force_online_signin) { |
375 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 375 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
376 | 376 |
377 // Do not update local state if data stored or cached outside the user's | 377 // Do not update local state if data stored or cached outside the user's |
378 // cryptohome is to be treated as ephemeral. | 378 // cryptohome is to be treated as ephemeral. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 return; // Ignore if there is no such user. | 450 return; // Ignore if there is no such user. |
451 } | 451 } |
452 | 452 |
453 // Do not update local state if data stored or cached outside the user's | 453 // Do not update local state if data stored or cached outside the user's |
454 // cryptohome is to be treated as ephemeral. | 454 // cryptohome is to be treated as ephemeral. |
455 if (IsUserNonCryptohomeDataEphemeral(account_id)) | 455 if (IsUserNonCryptohomeDataEphemeral(account_id)) |
456 return; | 456 return; |
457 | 457 |
458 DictionaryPrefUpdate user_type_update(GetLocalState(), kUserType); | 458 DictionaryPrefUpdate user_type_update(GetLocalState(), kUserType); |
459 user_type_update->SetWithoutPathExpansion( | 459 user_type_update->SetWithoutPathExpansion( |
460 account_id.GetUserEmail(), | 460 account_id.GetUserEmail(), new base::Value(static_cast<int>(user_type))); |
461 new base::FundamentalValue(static_cast<int>(user_type))); | |
462 GetLocalState()->CommitPendingWrite(); | 461 GetLocalState()->CommitPendingWrite(); |
463 } | 462 } |
464 | 463 |
465 void UserManagerBase::UpdateUserAccountData( | 464 void UserManagerBase::UpdateUserAccountData( |
466 const AccountId& account_id, | 465 const AccountId& account_id, |
467 const UserAccountData& account_data) { | 466 const UserAccountData& account_data) { |
468 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 467 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
469 | 468 |
470 SaveUserDisplayName(account_id, account_data.display_name()); | 469 SaveUserDisplayName(account_id, account_data.display_name()); |
471 | 470 |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 } | 1089 } |
1091 | 1090 |
1092 void UserManagerBase::DeleteUser(User* user) { | 1091 void UserManagerBase::DeleteUser(User* user) { |
1093 const bool is_active_user = (user == active_user_); | 1092 const bool is_active_user = (user == active_user_); |
1094 delete user; | 1093 delete user; |
1095 if (is_active_user) | 1094 if (is_active_user) |
1096 active_user_ = nullptr; | 1095 active_user_ = nullptr; |
1097 } | 1096 } |
1098 | 1097 |
1099 } // namespace user_manager | 1098 } // namespace user_manager |
OLD | NEW |