Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: components/user_manager/user_manager_base.cc

Issue 2201493002: [Merge to M53] arc: Implement safe access to ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2785
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_views_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 // Data belonging to the guest and demo users is always ephemeral. 636 // Data belonging to the guest and demo users is always ephemeral.
637 if (IsGuestAccountId(account_id) || IsDemoApp(account_id)) 637 if (IsGuestAccountId(account_id) || IsDemoApp(account_id))
638 return true; 638 return true;
639 639
640 // Data belonging to the public accounts is always ephemeral. 640 // Data belonging to the public accounts is always ephemeral.
641 const User* user = FindUser(account_id); 641 const User* user = FindUser(account_id);
642 if (user && user->GetType() == USER_TYPE_PUBLIC_ACCOUNT) 642 if (user && user->GetType() == USER_TYPE_PUBLIC_ACCOUNT)
643 return true; 643 return true;
644 644
645 // Ephemeral users. 645 // Ephemeral users.
646 if (user && user->GetType() == USER_TYPE_REGULAR && 646 if (AreEphemeralUsersEnabled() && user &&
647 user->GetType() == USER_TYPE_REGULAR &&
647 FindUserInList(account_id) == nullptr) { 648 FindUserInList(account_id) == nullptr) {
648 return true; 649 return true;
649 } 650 }
650 651
651 return false; 652 return false;
652 } 653 }
653 654
654 void UserManagerBase::AddObserver(UserManager::Observer* obs) { 655 void UserManagerBase::AddObserver(UserManager::Observer* obs) {
655 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 656 DCHECK(task_runner_->RunsTasksOnCurrentThread());
656 observer_list_.AddObserver(obs); 657 observer_list_.AddObserver(obs);
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 } 1074 }
1074 1075
1075 void UserManagerBase::DeleteUser(User* user) { 1076 void UserManagerBase::DeleteUser(User* user) {
1076 const bool is_active_user = (user == active_user_); 1077 const bool is_active_user = (user == active_user_);
1077 delete user; 1078 delete user;
1078 if (is_active_user) 1079 if (is_active_user)
1079 active_user_ = nullptr; 1080 active_user_ = nullptr;
1080 } 1081 }
1081 1082
1082 } // namespace user_manager 1083 } // namespace user_manager
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_views_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698