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

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: Fix test 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..f0ba4ba695e7efa1ba42588f100e3485f9e1adf0 100644
--- a/chromeos/login/login_state.h
+++ b/chromeos/login/login_state.h
@@ -51,10 +51,19 @@ 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 when the
+ // primary user initialy logs in. Also notifies 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 (e.g. from the
+ // login screen).
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 +93,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 +103,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
« no previous file with comments | « chrome/browser/extensions/api/networking_private/networking_private_api_chromeos.cc ('k') | chromeos/login/login_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698