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

Unified Diff: chromeos/login/login_state.h

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.h
diff --git a/chromeos/login/login_state.h b/chromeos/login/login_state.h
index 246bab9fe38a6defa98898ddcc9b2dffd15cb810..6d403620698fc12a2e567828f4b13d4f97f028d7 100644
--- a/chromeos/login/login_state.h
+++ b/chromeos/login/login_state.h
@@ -51,10 +51,18 @@ class CHROMEOS_EXPORT LoginState {
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
- // Set the logged in state and user type.
+ // Sets the logged in state, user type, and primary user hash. Also notifies
pneubeck (no reviews) 2014/06/12 09:51:01 I find this interface a bit odd in the light of mu
stevenjb 2014/06/12 20:27:51 This should be called exactly once when a user log
+ // observers.
+ void SetLoggedInStateAndPrimaryUser(
+ LoggedInState state,
+ LoggedInUserType type,
+ const std::string& primary_user_hash);
+
+ // Sets the logged in state and user type. Also notifies observers. Used
+ // in tests or situations where there is no primary user.
void SetLoggedInState(LoggedInState state, LoggedInUserType type);
- // Get the logged in user type.
+ // Gets the logged in user type.
LoggedInUserType GetLoggedInUserType() const;
// Returns true if a user is considered to be logged in.
@@ -84,6 +92,8 @@ class CHROMEOS_EXPORT LoginState {
always_logged_in_ = always_logged_in;
}
+ const std::string& primary_user_hash() const { return primary_user_hash_; }
+
private:
LoginState();
virtual ~LoginState();
@@ -92,6 +102,7 @@ class CHROMEOS_EXPORT LoginState {
LoggedInState logged_in_state_;
LoggedInUserType logged_in_user_type_;
+ std::string primary_user_hash_;
ObserverList<Observer> observer_list_;
// If true, it always thinks the current status as logged in. Set to true by

Powered by Google App Engine
This is Rietveld 408576698