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 { ...@@ -809,6 +809,12 @@ ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const {
} }
if (maximized) { 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; return ShelfBackgroundType::kMaximized;
} }
......
...@@ -1418,7 +1418,7 @@ TEST_P(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) { ...@@ -1418,7 +1418,7 @@ TEST_P(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) {
UnlockScreen(); UnlockScreen();
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
EXPECT_EQ(ShelfBackgroundType::kMaximized, EXPECT_EQ(ShelfBackgroundType::kDefaultBg,
GetShelfWidget()->GetBackgroundType()); GetShelfWidget()->GetBackgroundType());
} }
...@@ -2637,8 +2637,8 @@ TEST_P(ShelfLayoutManagerTest, TabletModeTransitionWithAppListVisible) { ...@@ -2637,8 +2637,8 @@ TEST_P(ShelfLayoutManagerTest, TabletModeTransitionWithAppListVisible) {
EXPECT_EQ(ShelfBackgroundType::kInApp, GetShelfWidget()->GetBackgroundType()); EXPECT_EQ(ShelfBackgroundType::kInApp, GetShelfWidget()->GetBackgroundType());
} }
// Verify that the auto-hide shelf has default background by default and has // Verify that the auto-hide shelf has default background by default and still
// maxmimized background when a window is maximized. // has the default background when a window is maximized in clamshell mode.
TEST_P(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) { TEST_P(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) {
EXPECT_EQ(ShelfBackgroundType::kDefaultBg, EXPECT_EQ(ShelfBackgroundType::kDefaultBg,
GetShelfWidget()->GetBackgroundType()); GetShelfWidget()->GetBackgroundType());
...@@ -2651,7 +2651,7 @@ TEST_P(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) { ...@@ -2651,7 +2651,7 @@ TEST_P(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) {
GetShelfWidget()->GetBackgroundType()); GetShelfWidget()->GetBackgroundType());
w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
EXPECT_EQ(ShelfBackgroundType::kMaximized, EXPECT_EQ(ShelfBackgroundType::kDefaultBg,
GetShelfWidget()->GetBackgroundType()); 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