Commit 9f422fb8 authored by Matthew Mourgos's avatar Matthew Mourgos Committed by Commit Bot

CrOS Shelf: Ensure maximized auto-hide shelf is transparent in clamshell mode

Bug: 1031651
Change-Id: Ic6d663fc798078db3f5099e3bae4f2737a111503
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1973150Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Commit-Queue: Matthew Mourgos <mmourgos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726679}
parent cb57107e
......@@ -809,6 +809,12 @@ ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const {
}
if (maximized) {
// When a window is maximized, if the auto-hide shelf is enabled and we are
// in clamshell mode, the shelf will keep the default transparent
// background.
if (!IsTabletModeEnabled() && state_.visibility_state == SHELF_AUTO_HIDE)
return ShelfBackgroundType::kDefaultBg;
return ShelfBackgroundType::kMaximized;
}
......
......@@ -1418,7 +1418,7 @@ TEST_P(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) {
UnlockScreen();
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
EXPECT_EQ(ShelfBackgroundType::kMaximized,
EXPECT_EQ(ShelfBackgroundType::kDefaultBg,
GetShelfWidget()->GetBackgroundType());
}
......@@ -2637,8 +2637,8 @@ TEST_P(ShelfLayoutManagerTest, TabletModeTransitionWithAppListVisible) {
EXPECT_EQ(ShelfBackgroundType::kInApp, GetShelfWidget()->GetBackgroundType());
}
// Verify that the auto-hide shelf has default background by default and has
// maxmimized background when a window is maximized.
// Verify that the auto-hide shelf has default background by default and still
// has the default background when a window is maximized in clamshell mode.
TEST_P(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) {
EXPECT_EQ(ShelfBackgroundType::kDefaultBg,
GetShelfWidget()->GetBackgroundType());
......@@ -2651,7 +2651,7 @@ TEST_P(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) {
GetShelfWidget()->GetBackgroundType());
w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
EXPECT_EQ(ShelfBackgroundType::kMaximized,
EXPECT_EQ(ShelfBackgroundType::kDefaultBg,
GetShelfWidget()->GetBackgroundType());
}
......
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