Commit f4de028c authored by Xiaoqian Dai's avatar Xiaoqian Dai Committed by Commit Bot

back gesture nudge: Fix weird fade out animation when exiting tablet mode.

It seems the reason for that AlwaysOnTop container is still affected by
workspace change - like when exiting tablet mode, workspace bounds will
change, which then cause the windows in AlwaysOnTop container adjust
its bounds.

Since back gesture affordance is in OverlayContainer, I think it makes
sense to just move back gesture nudge into the same container as well.

Bug: 1056906, 1009005b
Change-Id: I9d2eb122b5530eaa668603ff5dc7f9b70c90994f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079631
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745313}
parent ee3d9cb5
...@@ -79,7 +79,7 @@ std::unique_ptr<views::Widget> CreateWidget() { ...@@ -79,7 +79,7 @@ std::unique_ptr<views::Widget> CreateWidget() {
params.name = "BackGestureContextualNudge"; params.name = "BackGestureContextualNudge";
params.layer_type = ui::LAYER_NOT_DRAWN; params.layer_type = ui::LAYER_NOT_DRAWN;
params.parent = Shell::GetPrimaryRootWindow()->GetChildById( params.parent = Shell::GetPrimaryRootWindow()->GetChildById(
kShellWindowId_AlwaysOnTopContainer); kShellWindowId_OverlayContainer);
widget->Init(std::move(params)); widget->Init(std::move(params));
// TODO(crbug.com/1009005): Get the bounds of the display that should show the // TODO(crbug.com/1009005): Get the bounds of the display that should show the
......
...@@ -130,8 +130,8 @@ TEST_F(BackGestureContextualNudgeControllerTest, ...@@ -130,8 +130,8 @@ TEST_F(BackGestureContextualNudgeControllerTest,
user1_perf_service(), contextual_tooltip::TooltipType::kBackGesture)); user1_perf_service(), contextual_tooltip::TooltipType::kBackGesture));
std::unique_ptr<aura::Window> window1 = CreateTestWindow(); std::unique_ptr<aura::Window> window1 = CreateTestWindow();
// If nudge() is true, it indicates that it's currently in animation.
EXPECT_TRUE(nudge()); EXPECT_TRUE(nudge());
EXPECT_TRUE(nudge()->widget()->GetLayer()->GetAnimator()->is_animating());
// At this moment, change window activation should cancel the previous nudge // At this moment, change window activation should cancel the previous nudge
// showup animation on |window1|, and start show nudge on |window2|. // showup animation on |window1|, and start show nudge on |window2|.
...@@ -139,7 +139,6 @@ TEST_F(BackGestureContextualNudgeControllerTest, ...@@ -139,7 +139,6 @@ TEST_F(BackGestureContextualNudgeControllerTest,
EXPECT_FALSE(nudge()->ShouldNudgeCountAsShown()); EXPECT_FALSE(nudge()->ShouldNudgeCountAsShown());
EXPECT_TRUE(contextual_tooltip::ShouldShowNudge( EXPECT_TRUE(contextual_tooltip::ShouldShowNudge(
user1_perf_service(), contextual_tooltip::TooltipType::kBackGesture)); user1_perf_service(), contextual_tooltip::TooltipType::kBackGesture));
EXPECT_TRUE(nudge()->widget()->GetLayer()->GetAnimator()->is_animating());
// Wait until nudge animation is finished. // Wait until nudge animation is finished.
WaitNudgeAnimationDone(); WaitNudgeAnimationDone();
...@@ -160,7 +159,6 @@ TEST_F(BackGestureContextualNudgeControllerTest, ...@@ -160,7 +159,6 @@ TEST_F(BackGestureContextualNudgeControllerTest,
std::unique_ptr<aura::Window> window = CreateTestWindow(); std::unique_ptr<aura::Window> window = CreateTestWindow();
EXPECT_TRUE(nudge()); EXPECT_TRUE(nudge());
EXPECT_TRUE(nudge()->widget()->GetLayer()->GetAnimator()->is_animating());
TabletModeControllerTestApi().LeaveTabletMode(); TabletModeControllerTestApi().LeaveTabletMode();
WaitNudgeAnimationDone(); WaitNudgeAnimationDone();
......
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