Commit 2e2ca2c7 authored by Manu Cornet's avatar Manu Cornet Committed by Commit Bot

CrOS Shelf: Never show the hotseat in login/lock screens

Change-Id: I31fa43e85afc0cfe7f5d7be1b4c75b2200aa6e4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764116
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Auto-Submit: Manu Cornet <manucornet@chromium.org>
Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689066}
parent 9aa45129
...@@ -2668,7 +2668,7 @@ TEST_F(LockContentsViewUnitTest, MediaControlsHiddenOnLoginScreen) { ...@@ -2668,7 +2668,7 @@ TEST_F(LockContentsViewUnitTest, MediaControlsHiddenOnLoginScreen) {
EXPECT_EQ(nullptr, lock_contents.media_controls_view()); EXPECT_EQ(nullptr, lock_contents.media_controls_view());
} }
TEST_F(LockContentsViewUnitTest, NoNavigationWidgetOnLockScreen) { TEST_F(LockContentsViewUnitTest, NoNavigationOrHotseatOnLockScreen) {
GetSessionControllerClient()->SetSessionState( GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOCKED); session_manager::SessionState::LOCKED);
LockContentsView* contents = new LockContentsView( LockContentsView* contents = new LockContentsView(
...@@ -2681,6 +2681,8 @@ TEST_F(LockContentsViewUnitTest, NoNavigationWidgetOnLockScreen) { ...@@ -2681,6 +2681,8 @@ TEST_F(LockContentsViewUnitTest, NoNavigationWidgetOnLockScreen) {
Shelf::ForWindow(widget->GetNativeWindow())->shelf_widget(); Shelf::ForWindow(widget->GetNativeWindow())->shelf_widget();
EXPECT_FALSE(shelf_widget->navigation_widget()->IsVisible()) EXPECT_FALSE(shelf_widget->navigation_widget()->IsVisible())
<< "The navigation widget should not appear on the lock screen."; << "The navigation widget should not appear on the lock screen.";
EXPECT_FALSE(shelf_widget->hotseat_widget()->IsVisible())
<< "The hotseat widget should not appear on the lock screen.";
} }
} // namespace ash } // namespace ash
...@@ -523,11 +523,13 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterShutdownButtonStatusChange) { ...@@ -523,11 +523,13 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterShutdownButtonStatusChange) {
EXPECT_TRUE(IsButtonEnabled(LoginShelfView::kShutdown)); EXPECT_TRUE(IsButtonEnabled(LoginShelfView::kShutdown));
} }
TEST_F(LoginShelfViewTest, ShouldNotShowNavigationWidget) { TEST_F(LoginShelfViewTest, ShouldNotShowNavigationAndHotseat) {
gfx::NativeWindow window = login_shelf_view_->GetWidget()->GetNativeWindow(); gfx::NativeWindow window = login_shelf_view_->GetWidget()->GetNativeWindow();
ShelfWidget* shelf_widget = Shelf::ForWindow(window)->shelf_widget(); ShelfWidget* shelf_widget = Shelf::ForWindow(window)->shelf_widget();
EXPECT_FALSE(shelf_widget->navigation_widget()->IsVisible()) EXPECT_FALSE(shelf_widget->navigation_widget()->IsVisible())
<< "The navigation widget should not appear in the login shelf."; << "The navigation widget should not appear in the login shelf.";
EXPECT_FALSE(shelf_widget->hotseat_widget()->IsVisible())
<< "The hotseat widget should not appear in the login shelf.";
} }
TEST_F(LoginShelfViewTest, ParentAccessButtonVisibility) { TEST_F(LoginShelfViewTest, ParentAccessButtonVisibility) {
......
...@@ -1050,9 +1050,12 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity( ...@@ -1050,9 +1050,12 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity(
shelf_bounds.InsetsFrom(target_bounds.shelf_bounds_in_shelf))); shelf_bounds.InsetsFrom(target_bounds.shelf_bounds_in_shelf)));
shelf_widget_->GetContentsView()->Layout(); shelf_widget_->GetContentsView()->Layout();
// Never show the navigation widget outside of an active session. // Never show the navigation widget or the hotseat outside of an active
if (!state_.IsActiveSessionState()) // session.
if (!state_.IsActiveSessionState()) {
nav_widget->Hide(); nav_widget->Hide();
hotseat_widget->Hide();
}
// Setting visibility during an animation causes the visibility property to // Setting visibility during an animation causes the visibility property to
// animate. Set the visibility property without an animation. // animate. Set the visibility property without an animation.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment