Commit 6559ae28 authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Revert "[reland] In tablet mode, tap on overview background should go to home screen."

This reverts commit 82f9896f.

Reason for revert: 
OverviewSessionWithDragFromShelfFeatureTest.TapOnBackgroundGoToHome is failing on linux-chromeos-rel
https://ci.chromium.org/p/chromium/builders/ci/linux-chromeos-rel

Original change's description:
> [reland] In tablet mode, tap on overview background should go to home screen.
> 
> Clamshell mode behavior will remain the same, i.e., tapping on the
> overview background will return to its previous state, it can either be
> in-app or home screen.
> 
> Bug: 997885
> 
> Change-Id: I2dae82657d4d92876c834c78dd62d53830fbe6cf
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865264
> Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
> Reviewed-by: Xiaoqian Dai <xdai@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#707036}

TBR=xiyuan@chromium.org,xdai@chromium.org

Change-Id: I5dd88e82ecb8d5c3772be87fb749c3da88ba6d08
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 997885
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867472Reviewed-by: default avatarLan Wei <lanwei@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707132}
parent 9164724c
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#include "ash/wm/overview/overview_grid_event_handler.h" #include "ash/wm/overview/overview_grid_event_handler.h"
#include "ash/home_screen/home_screen_controller.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/root_window_controller.h" #include "ash/root_window_controller.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/wallpaper/wallpaper_view.h" #include "ash/wallpaper/wallpaper_view.h"
...@@ -14,7 +12,6 @@ ...@@ -14,7 +12,6 @@
#include "ash/wm/overview/overview_grid.h" #include "ash/wm/overview/overview_grid.h"
#include "ash/wm/overview/overview_utils.h" #include "ash/wm/overview/overview_utils.h"
#include "ui/compositor/compositor.h" #include "ui/compositor/compositor.h"
#include "ui/display/screen.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/events/gestures/fling_curve.h" #include "ui/events/gestures/fling_curve.h"
...@@ -131,20 +128,8 @@ void OverviewGridEventHandler::HandleClickOrTap(ui::Event* event) { ...@@ -131,20 +128,8 @@ void OverviewGridEventHandler::HandleClickOrTap(ui::Event* event) {
CHECK_EQ(ui::EP_PRETARGET, event->phase()); CHECK_EQ(ui::EP_PRETARGET, event->phase());
// Events that happen while app list is sliding out during overview should // Events that happen while app list is sliding out during overview should
// be ignored to prevent overview from disappearing out from under the user. // be ignored to prevent overview from disappearing out from under the user.
if (!IsSlidingOutOverviewFromShelf()) { if (!IsSlidingOutOverviewFromShelf())
if (Shell::Get()->tablet_mode_controller()->InTabletMode() && Shell::Get()->overview_controller()->EndOverview();
features::IsDragFromShelfToHomeOrOverviewEnabled()) {
// In tablet mode, clicking on tapping on the wallpaper background will
// always head back to home launcher screen.
int64_t display_id = display::Screen::GetScreen()
->GetDisplayNearestWindow(
static_cast<aura::Window*>(event->target()))
.id();
Shell::Get()->home_screen_controller()->GoHome(display_id);
} else {
Shell::Get()->overview_controller()->EndOverview();
}
}
event->StopPropagation(); event->StopPropagation();
} }
......
...@@ -17,13 +17,11 @@ ...@@ -17,13 +17,11 @@
#include "ash/display/screen_orientation_controller.h" #include "ash/display/screen_orientation_controller.h"
#include "ash/display/screen_orientation_controller_test_api.h" #include "ash/display/screen_orientation_controller_test_api.h"
#include "ash/drag_drop/drag_drop_controller.h" #include "ash/drag_drop/drag_drop_controller.h"
#include "ash/home_screen/home_screen_controller.h"
#include "ash/magnifier/docked_magnifier_controller_impl.h" #include "ash/magnifier/docked_magnifier_controller_impl.h"
#include "ash/public/cpp/app_types.h" #include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/fps_counter.h" #include "ash/public/cpp/fps_counter.h"
#include "ash/public/cpp/shelf_config.h" #include "ash/public/cpp/shelf_config.h"
#include "ash/public/cpp/test/shell_test_api.h"
#include "ash/public/cpp/window_properties.h" #include "ash/public/cpp/window_properties.h"
#include "ash/screen_util.h" #include "ash/screen_util.h"
#include "ash/shelf/shelf.h" #include "ash/shelf/shelf.h"
...@@ -2792,50 +2790,6 @@ TEST_P(OverviewSessionTest, ShelfAlignmentChangeWhileInOverview) { ...@@ -2792,50 +2790,6 @@ TEST_P(OverviewSessionTest, ShelfAlignmentChangeWhileInOverview) {
EXPECT_FALSE(InOverviewSession()); EXPECT_FALSE(InOverviewSession());
} }
// The class to test overview behavior with kDragFromShelfToHomeOrOverview flag
// enabled.
class OverviewSessionWithDragFromShelfFeatureTest : public OverviewSessionTest {
public:
OverviewSessionWithDragFromShelfFeatureTest() = default;
~OverviewSessionWithDragFromShelfFeatureTest() override = default;
void SetUp() override {
scoped_feature_list_.InitAndEnableFeature(
features::kDragFromShelfToHomeOrOverview);
OverviewSessionTest::SetUp();
EnterTabletMode();
}
private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(OverviewSessionWithDragFromShelfFeatureTest);
};
// Tests that in tablet mode, tapping on the background will always go to home
// screen.
TEST_P(OverviewSessionWithDragFromShelfFeatureTest, TapOnBackgroundGoToHome) {
UpdateDisplay("800x600");
std::unique_ptr<aura::Window> window(CreateTestWindow());
WindowState* window_state = WindowState::Get(window.get());
EXPECT_FALSE(window_state->IsMinimized());
EXPECT_FALSE(Shell::Get()->home_screen_controller()->IsHomeScreenVisible());
ToggleOverview();
EXPECT_TRUE(InOverviewSession());
// Tap on the background.
ui::ScopedAnimationDurationScaleMode test_duration_mode(
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
GetEventGenerator()->GestureTapAt(gfx::Point(10, 10));
ShellTestApi().WaitForOverviewAnimationState(
OverviewAnimationState::kExitAnimationComplete);
EXPECT_FALSE(InOverviewSession());
EXPECT_TRUE(window_state->IsMinimized());
EXPECT_TRUE(Shell::Get()->home_screen_controller()->IsHomeScreenVisible());
}
// TODO(sammiequon): Merge this into SplitViewOverviewSessionTest and rename // TODO(sammiequon): Merge this into SplitViewOverviewSessionTest and rename
// that to TabletModeOverviewSessionTest. // that to TabletModeOverviewSessionTest.
class OverviewSessionNewLayoutTest : public OverviewSessionTest { class OverviewSessionNewLayoutTest : public OverviewSessionTest {
...@@ -5297,8 +5251,5 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -5297,8 +5251,5 @@ INSTANTIATE_TEST_SUITE_P(
, ,
SplitViewOverviewSessionInClamshellTestMultiDisplayOnly, SplitViewOverviewSessionInClamshellTestMultiDisplayOnly,
testing::Values(true)); testing::Values(true));
INSTANTIATE_TEST_SUITE_P(,
OverviewSessionWithDragFromShelfFeatureTest,
testing::Bool());
} // namespace ash } // namespace ash
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