diff options
author | tbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-14 21:14:40 +0000 |
---|---|---|
committer | tbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-14 21:14:40 +0000 |
commit | 596ca12542dea0f2db4c42afe28d52e515dfe578 (patch) | |
tree | 15f53a31dd40e49f838dd0ab37da61e3b7fb226e /chromeos/login | |
parent | c8ef1d0bc63aa014ba0fb94049671b371c0d5d18 (diff) | |
download | chromium_src-596ca12542dea0f2db4c42afe28d52e515dfe578.zip chromium_src-596ca12542dea0f2db4c42afe28d52e515dfe578.tar.gz chromium_src-596ca12542dea0f2db4c42afe28d52e515dfe578.tar.bz2 |
Make networks unshared in wifi_config dialog for kiosk apps and guest mode
BUG=355898
TEST=
1.1. Start a kiosk app without network connection,
1.2. when offered an option, select a WPA/WEP protected network (make sure
it's not shared)
1.3. A network configuration dialog should appear;
"Share this network with other users" checkbox should be disabled and unchecked
1.4. Enter credentials and connect.
1.5. When connected, exit and make sure that network config dialog
is shown when connecting to the same network at the login screen
2.1. Login as guest and try connecting to a WPA/WEP protected unshared network.
proceed with step 1.3.
Review URL: https://codereview.chromium.org/232493002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263727 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/login')
-rw-r--r-- | chromeos/login/login_state.cc | 23 | ||||
-rw-r--r-- | chromeos/login/login_state.h | 6 |
2 files changed, 22 insertions, 7 deletions
diff --git a/chromeos/login/login_state.cc b/chromeos/login/login_state.cc index db26d15..d911548 100644 --- a/chromeos/login/login_state.cc +++ b/chromeos/login/login_state.cc @@ -101,17 +101,26 @@ bool LoginState::IsGuestUser() const { return false; } +bool LoginState::IsKioskApp() const { + return logged_in_user_type_ == LoginState::LOGGED_IN_USER_KIOSK_APP; +} + +bool LoginState::UserHasNetworkProfile() const { + if (!IsUserLoggedIn()) + return false; + return logged_in_user_type_ != LOGGED_IN_USER_RETAIL_MODE && + logged_in_user_type_ != LOGGED_IN_USER_PUBLIC_ACCOUNT; +} + bool LoginState::IsUserAuthenticated() const { - LoggedInUserType type = logged_in_user_type_; - return type == chromeos::LoginState::LOGGED_IN_USER_REGULAR || - type == chromeos::LoginState::LOGGED_IN_USER_OWNER || - type == chromeos::LoginState::LOGGED_IN_USER_LOCALLY_MANAGED; + return logged_in_user_type_ == LOGGED_IN_USER_REGULAR || + logged_in_user_type_ == LOGGED_IN_USER_OWNER || + logged_in_user_type_ == LOGGED_IN_USER_LOCALLY_MANAGED; } bool LoginState::IsUserGaiaAuthenticated() const { - LoggedInUserType type = logged_in_user_type_; - return type == chromeos::LoginState::LOGGED_IN_USER_REGULAR || - type == chromeos::LoginState::LOGGED_IN_USER_OWNER; + return logged_in_user_type_ == LOGGED_IN_USER_REGULAR || + logged_in_user_type_ == LOGGED_IN_USER_OWNER; } // Private methods diff --git a/chromeos/login/login_state.h b/chromeos/login/login_state.h index 73a83dd..246bab9 100644 --- a/chromeos/login/login_state.h +++ b/chromeos/login/login_state.h @@ -67,6 +67,12 @@ class CHROMEOS_EXPORT LoginState { // Returns true if logged in and is a guest, retail, or public user. bool IsGuestUser() const; + // Returns true if logged in as a kiosk app. + bool IsKioskApp() const; + + // Whether a network profile is created for the user. + bool UserHasNetworkProfile() const; + // Returns true if the user is an authenticated user (i.e. non public account) bool IsUserAuthenticated() const; |