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

Unified Diff: chromeos/login/login_state.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: Fail to configure networks from non-primary user 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/login/login_state.cc
diff --git a/chromeos/login/login_state.cc b/chromeos/login/login_state.cc
index d9115487c547884059b3652b27f3d64b7e649932..b225c2ba9998ddc2042e37e7974bcd31562bd2d0 100644
--- a/chromeos/login/login_state.cc
+++ b/chromeos/login/login_state.cc
@@ -57,6 +57,16 @@ void LoginState::RemoveObserver(Observer* observer) {
observer_list_.RemoveObserver(observer);
}
+void LoginState::SetLoggedInStateAndPrimaryUser(
+ LoggedInState state,
+ LoggedInUserType type,
+ const std::string& primary_user_hash) {
+ DCHECK(type != LOGGED_IN_USER_NONE);
+ primary_user_hash_ = primary_user_hash;
+ VLOG(1) << "LoggedInStateUser: " << primary_user_hash;
+ SetLoggedInState(state, type);
+}
+
void LoginState::SetLoggedInState(LoggedInState state,
LoggedInUserType type) {
if (state == logged_in_state_ && type == logged_in_user_type_)
@@ -64,6 +74,8 @@ void LoginState::SetLoggedInState(LoggedInState state,
VLOG(1) << "LoggedInState: " << state << " UserType: " << type;
logged_in_state_ = state;
logged_in_user_type_ = type;
+ if (type == LOGGED_IN_USER_NONE)
pneubeck (no reviews) 2014/06/12 09:51:00 don't we assume that we never logout?
stevenjb 2014/06/12 20:27:51 Perhaps, but I would prefer to be robust here in c
+ primary_user_hash_.clear();
NotifyObservers();
}

Powered by Google App Engine
This is Rietveld 408576698