Commit 8181edf2 authored by John Budorick's avatar John Budorick Committed by Commit Bot

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

This reverts commit 315b3895.

Reason for revert: new tests fail on linux-chromeos-rel: https://ci.chromium.org/p/chromium/builders/ci/linux-chromeos-rel/30281

Original change's description:
> 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: I82624e44024e273a343c20e3707cb1d97e31d594
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864026
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#706548}

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

Change-Id: I6a9b5666e168dab72d4192036c44d093388c4225
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 997885
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865556Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706616}
parent e37da94d
......@@ -4,8 +4,6 @@
#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/shell.h"
#include "ash/wallpaper/wallpaper_view.h"
......@@ -14,7 +12,6 @@
#include "ash/wm/overview/overview_grid.h"
#include "ash/wm/overview/overview_utils.h"
#include "ui/compositor/compositor.h"
#include "ui/display/screen.h"
#include "ui/events/event.h"
#include "ui/events/gestures/fling_curve.h"
......@@ -131,20 +128,8 @@ void OverviewGridEventHandler::HandleClickOrTap(ui::Event* event) {
CHECK_EQ(ui::EP_PRETARGET, event->phase());
// Events that happen while app list is sliding out during overview should
// be ignored to prevent overview from disappearing out from under the user.
if (!IsSlidingOutOverviewFromShelf()) {
if (Shell::Get()->tablet_mode_controller()->InTabletMode() &&
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();
}
}
if (!IsSlidingOutOverviewFromShelf())
Shell::Get()->overview_controller()->EndOverview();
event->StopPropagation();
}
......
......@@ -17,7 +17,6 @@
#include "ash/display/screen_orientation_controller.h"
#include "ash/display/screen_orientation_controller_test_api.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/public/cpp/app_types.h"
#include "ash/public/cpp/ash_features.h"
......@@ -2791,46 +2790,6 @@ TEST_P(OverviewSessionTest, ShelfAlignmentChangeWhileInOverview) {
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.
GetEventGenerator()->GestureTapAt(gfx::Point(10, 10));
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(InOverviewSession());
EXPECT_TRUE(window_state->IsMinimized());
EXPECT_TRUE(Shell::Get()->home_screen_controller()->IsHomeScreenVisible());
}
// TODO(sammiequon): Merge this into SplitViewOverviewSessionTest and rename
// that to TabletModeOverviewSessionTest.
class OverviewSessionNewLayoutTest : public OverviewSessionTest {
......@@ -5292,8 +5251,5 @@ INSTANTIATE_TEST_SUITE_P(
,
SplitViewOverviewSessionInClamshellTestMultiDisplayOnly,
testing::Values(true));
INSTANTIATE_TEST_SUITE_P(,
OverviewSessionWithDragFromShelfFeatureTest,
testing::Bool());
} // 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