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

Side by Side Diff: chrome/browser/chromeos/login/users/user_manager_impl.cc

Issue 242983004: Disable some API calls in networkingPrivate for non-primary user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adddress feedback Created 6 years, 6 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 | Annotate | Revision Log
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 "chrome/browser/chromeos/login/users/user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/users/user_manager_impl.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <set> 8 #include <set>
9 9
10 #include "ash/multi_profile_uma.h" 10 #include "ash/multi_profile_uma.h"
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 login_user_type = LoginState::LOGGED_IN_USER_RETAIL_MODE; 1956 login_user_type = LoginState::LOGGED_IN_USER_RETAIL_MODE;
1957 else if (active_user_->GetType() == User::USER_TYPE_PUBLIC_ACCOUNT) 1957 else if (active_user_->GetType() == User::USER_TYPE_PUBLIC_ACCOUNT)
1958 login_user_type = LoginState::LOGGED_IN_USER_PUBLIC_ACCOUNT; 1958 login_user_type = LoginState::LOGGED_IN_USER_PUBLIC_ACCOUNT;
1959 else if (active_user_->GetType() == User::USER_TYPE_LOCALLY_MANAGED) 1959 else if (active_user_->GetType() == User::USER_TYPE_LOCALLY_MANAGED)
1960 login_user_type = LoginState::LOGGED_IN_USER_LOCALLY_MANAGED; 1960 login_user_type = LoginState::LOGGED_IN_USER_LOCALLY_MANAGED;
1961 else if (active_user_->GetType() == User::USER_TYPE_KIOSK_APP) 1961 else if (active_user_->GetType() == User::USER_TYPE_KIOSK_APP)
1962 login_user_type = LoginState::LOGGED_IN_USER_KIOSK_APP; 1962 login_user_type = LoginState::LOGGED_IN_USER_KIOSK_APP;
1963 else 1963 else
1964 login_user_type = LoginState::LOGGED_IN_USER_REGULAR; 1964 login_user_type = LoginState::LOGGED_IN_USER_REGULAR;
1965 1965
1966 LoginState::Get()->SetLoggedInState(logged_in_state, login_user_type); 1966 if (primary_user_) {
1967 LoginState::Get()->SetLoggedInStateAndPrimaryUser(
1968 logged_in_state, login_user_type, primary_user_->username_hash());
1969 } else {
1970 LoginState::Get()->SetLoggedInState(logged_in_state, login_user_type);
1971 }
1967 } 1972 }
1968 1973
1969 void UserManagerImpl::SetLRUUser(User* user) { 1974 void UserManagerImpl::SetLRUUser(User* user) {
1970 UserList::iterator it = std::find(lru_logged_in_users_.begin(), 1975 UserList::iterator it = std::find(lru_logged_in_users_.begin(),
1971 lru_logged_in_users_.end(), 1976 lru_logged_in_users_.end(),
1972 user); 1977 user);
1973 if (it != lru_logged_in_users_.end()) 1978 if (it != lru_logged_in_users_.end())
1974 lru_logged_in_users_.erase(it); 1979 lru_logged_in_users_.erase(it);
1975 lru_logged_in_users_.insert(lru_logged_in_users_.begin(), user); 1980 lru_logged_in_users_.insert(lru_logged_in_users_.begin(), user);
1976 } 1981 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 } 2105 }
2101 2106
2102 void UserManagerImpl::DeleteUser(User* user) { 2107 void UserManagerImpl::DeleteUser(User* user) {
2103 const bool is_active_user = (user == active_user_); 2108 const bool is_active_user = (user == active_user_);
2104 delete user; 2109 delete user;
2105 if (is_active_user) 2110 if (is_active_user)
2106 active_user_ = NULL; 2111 active_user_ = NULL;
2107 } 2112 }
2108 2113
2109 } // namespace chromeos 2114 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698