Commit d34608f4 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Remove code to hide backdrop for opened launcher

The removed code was originally used to make shelf remain transparent
for fullscreen backdrop window [1]. Now the shelf is no longer
transparent, it should be removed.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/606706

Bug: b/79201599
Change-Id: Ic5b214cc714a7699d8ea4fda1a059a7d03104f6c
Reviewed-on: https://chromium-review.googlesource.com/1224640Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591403}
parent 1a223b59
......@@ -124,23 +124,6 @@ void BackdropController::UpdateBackdrop() {
return;
}
AppListControllerImpl* app_list_controller =
Shell::Get()->app_list_controller();
// Hide the backdrop when it is in the same display of launcher and
// launcher is not in home launcher mode.
if (app_list_controller &&
!app_list_controller->IsHomeLauncherEnabledInTabletMode() &&
app_list_controller->GetTargetVisibility() &&
app_list_controller->presenter()->GetView() &&
container_->GetRootWindow() == app_list_controller->presenter()
->GetView()
->GetWidget()
->GetNativeView()
->GetRootWindow()) {
Hide();
return;
}
aura::Window* window = GetTopmostWindowWithBackdrop();
if (!window) {
// Hide backdrop since no suitable window was found.
......
......@@ -1482,82 +1482,6 @@ TEST_F(WorkspaceLayoutManagerBackdropTest, SpokenFeedbackFullscreenBackground) {
EXPECT_EQ(kNoSoundKey, client.GetPlayedEarconAndReset());
}
TEST_F(WorkspaceLayoutManagerBackdropTest,
DualDisplayShowAppListWithBackdropState) {
// Create two displays.
UpdateDisplay("0+0-200x200,+200+0-100x100");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
EXPECT_EQ(root_windows.size(), 2u);
// Create a window in each display and show them in maximized state.
aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]);
window_1->SetBounds(gfx::Rect(0, 0, 100, 100));
window_1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
window_1->Show();
aura::Window* window_2 = CreateTestWindowInParent(root_windows[1]);
window_2->SetBounds(gfx::Rect(201, 0, 100, 100));
window_2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
window_2->Show();
RootWindowController* primary_controller =
Shell::GetPrimaryRootWindowController();
WorkspaceController* primary_wc = primary_controller->workspace_controller();
Shell::RootWindowControllerList controllers =
Shell::GetAllRootWindowControllers();
WorkspaceController* secondary_wc = nullptr;
RootWindowController* secondary_controller = nullptr;
EXPECT_EQ(controllers.size(), 2u);
for (size_t i = 0; i < controllers.size(); ++i) {
if (controllers[i] != primary_controller) {
secondary_controller = controllers[i];
secondary_wc = secondary_controller->workspace_controller();
}
}
// Turn on top window backdrop for two displays.
WorkspaceControllerTestApi primary_test_helper(primary_wc);
WorkspaceControllerTestApi secondary_test_helper(secondary_wc);
ShowTopWindowBackdropForContainer(default_container(), true);
EXPECT_TRUE(primary_test_helper.GetBackdropWindow());
ShowTopWindowBackdropForContainer(
secondary_controller->GetContainer(kShellWindowId_DefaultContainer),
true);
EXPECT_TRUE(secondary_test_helper.GetBackdropWindow());
// Showing the app list on the primary display should not hide the backdrop on
// the secondary display.
EXPECT_TRUE(primary_test_helper.GetBackdropWindow());
EXPECT_TRUE(secondary_test_helper.GetBackdropWindow());
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplay().id());
EXPECT_FALSE(primary_test_helper.GetBackdropWindow());
EXPECT_TRUE(secondary_test_helper.GetBackdropWindow());
}
// Fullscreen app list changes to visible should hide the backdrop, otherwise,
// should show the backdrop.
TEST_F(WorkspaceLayoutManagerBackdropTest,
BackdropUpdatesOnFullscreenAppListVisibilityNotification) {
WorkspaceController* wc = ShellTestApi(Shell::Get()).workspace_controller();
WorkspaceControllerTestApi test_helper(wc);
std::unique_ptr<aura::Window> window(
CreateTestWindow(gfx::Rect(0, 0, 100, 100)));
EXPECT_FALSE(test_helper.GetBackdropWindow());
// Turn the top window backdrop on.
ShowTopWindowBackdropForContainer(default_container(), true);
EXPECT_TRUE(test_helper.GetBackdropWindow());
ui::ScopedAnimationDurationScaleMode test_duration_mode(
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
EXPECT_TRUE(test_helper.GetBackdropWindow());
// Showing the fullscreen app list should hide the backdrop.
GetAppListTestHelper()->Show(GetPrimaryDisplay().id());
EXPECT_FALSE(test_helper.GetBackdropWindow());
// Dismissing the app list should cause the backdrop to be shown again.
GetAppListTestHelper()->Dismiss();
}
// TODO(crbug.com/803286): The npot texture check failed on asan tests bot.
// TODO(crbug.com/838756): Very flaky on mash_ash_unittests.
TEST_F(WorkspaceLayoutManagerBackdropTest, DISABLED_OpenAppListInOverviewMode) {
......
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