diff options
author | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-21 19:19:12 +0000 |
---|---|---|
committer | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-21 19:20:54 +0000 |
commit | 40448640c3f0dd932dbc48c59da9ec58dd36cf55 (patch) | |
tree | 4d30b3bbb7ea2e42e2942c8441fdc56287e50d98 /ash/system/user | |
parent | 9a59a5f17d2cc930d502e27cbc89f3f69fbd81c5 (diff) | |
download | chromium_src-40448640c3f0dd932dbc48c59da9ec58dd36cf55.zip chromium_src-40448640c3f0dd932dbc48c59da9ec58dd36cf55.tar.gz chromium_src-40448640c3f0dd932dbc48c59da9ec58dd36cf55.tar.bz2 |
Multiprofile security: Show a warning messagebox when desktop
casting/sharing is turned on upon user switch
Purpose of this change:
Asks the user with a system modal dialog box if he wants to
turn off screen sharing/screen casting and then switch users
or abort switching users.
BUG=353170
TEST=TrySwitchingUserTest.*
Review URL: https://codereview.chromium.org/496563002
Cr-Commit-Position: refs/heads/master@{#291152}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/user')
-rw-r--r-- | ash/system/user/tray_user.cc | 7 | ||||
-rw-r--r-- | ash/system/user/tray_user_separator.cc | 4 | ||||
-rw-r--r-- | ash/system/user/user_view.cc | 7 |
3 files changed, 13 insertions, 5 deletions
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc index cb86298..9851ba1 100644 --- a/ash/system/user/tray_user.cc +++ b/ash/system/user/tray_user.cc @@ -93,8 +93,11 @@ views::View* TrayUser::CreateDefaultView(user::LoginStatus status) { const SessionStateDelegate* session_state_delegate = Shell::GetInstance()->session_state_delegate(); - // If the screen is locked show only the currently active user. - if (multiprofile_index_ && session_state_delegate->IsUserSessionBlocked()) + // If the screen is locked or a system modal dialog box is shown, show only + // the currently active user. + if (multiprofile_index_ && + (session_state_delegate->IsUserSessionBlocked() || + Shell::GetInstance()->IsSystemModalWindowOpen())) return NULL; CHECK(user_ == NULL); diff --git a/ash/system/user/tray_user_separator.cc b/ash/system/user/tray_user_separator.cc index 7058d2f..d152a3b 100644 --- a/ash/system/user/tray_user_separator.cc +++ b/ash/system/user/tray_user_separator.cc @@ -26,8 +26,10 @@ views::View* TrayUserSeparator::CreateDefaultView(user::LoginStatus status) { const SessionStateDelegate* session_state_delegate = Shell::GetInstance()->session_state_delegate(); - // If the screen is locked, or only a single user is shown, show nothing. + // If the screen is locked, a system modal dialog or a single user is shown, + // show nothing. if (session_state_delegate->IsUserSessionBlocked() || + Shell::GetInstance()->IsSystemModalWindowOpen() || session_state_delegate->NumberOfLoggedInUsers() < 2) return NULL; diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc index 689764f..52f128d 100644 --- a/ash/system/user/user_view.cc +++ b/ash/system/user/user_view.cc @@ -400,8 +400,11 @@ void UserView::AddUserCard(user::LoginStatus login) { max_card_width -= logout_button_->GetPreferredSize().width(); user_card_view_ = new UserCardView(login, max_card_width, multiprofile_index_); - bool clickable = IsMultiProfileSupportedAndUserActive() || - IsMultiAccountSupportedAndUserActive(); + // The entry is clickable when no system modal dialog is open and one of the + // multi user options is active. + bool clickable = !Shell::GetInstance()->IsSystemModalWindowOpen() && + (IsMultiProfileSupportedAndUserActive() || + IsMultiAccountSupportedAndUserActive()); if (clickable) { // To allow the border to start before the icon, reduce the size before and // add an inset to the icon to get the spacing. |