Commit 653e4e18 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Avoid hide backdrop for homecher

Bug: 877163
Change-Id: I9f1b221bbbfbfb34d4a796c109ef7595e17bbc40
Reviewed-on: https://chromium-review.googlesource.com/1195928
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587636}
parent 6f0a60bf
......@@ -24,6 +24,7 @@
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shell.h"
#include "ash/shell_test_api.h"
#include "ash/test/ash_test_base.h"
#include "ash/wallpaper/wallpaper_controller_test_api.h"
#include "ash/wm/overview/window_selector_controller.h"
......@@ -32,6 +33,7 @@
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace_controller_test_api.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/run_loop.h"
......@@ -1607,4 +1609,19 @@ TEST_F(AppListPresenterDelegateHomeLauncherTest,
GetAppListTestHelper()->CheckVisibility(true);
}
// Test backdrop exists for active non-fullscreen window in tablet mode.
TEST_F(AppListPresenterDelegateHomeLauncherTest, BackdropTest) {
WorkspaceControllerTestApi test_helper(
ShellTestApi(Shell::Get()).workspace_controller());
EnableTabletMode(true);
GetAppListTestHelper()->CheckVisibility(true);
EXPECT_FALSE(test_helper.GetBackdropWindow());
std::unique_ptr<aura::Window> non_fullscreen_window(
CreateTestWindow(gfx::Rect(0, 0, 100, 100)));
non_fullscreen_window->Show();
GetAppListTestHelper()->CheckVisibility(true);
EXPECT_TRUE(test_helper.GetBackdropWindow());
}
} // namespace ash
......@@ -126,8 +126,11 @@ void BackdropController::UpdateBackdrop() {
AppListControllerImpl* app_list_controller =
Shell::Get()->app_list_controller();
// Only hide the backdrop of the display that launcher is opened at.
if (app_list_controller && app_list_controller->GetTargetVisibility() &&
// 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()
......
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