Commit 116b788f authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Revert "Fix regression that dev-shortcut to enable tablet mode doesn't show overview button"

This reverts commit 561b1956.

Reason for revert: This solution is broken, will land a proper fix soon.

Original change's description:
> Fix regression that dev-shortcut to enable tablet mode doesn't show overview button
> 
> This was a rgression caused by a previous CL of mine https://crrev.com/c/1865543.
> Using the developer keyboard shortcut to enable tablet mode should
> force the overview tray button visible even though the internal
> input events are not being blocked.
> 
> BUG=1016594, 925087
> TEST=Manually, added a new test.
> 
> Change-Id: Ic9046c07dcce9de03c5fc5acd10a2077d599c711
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872468
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#708222}

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

Change-Id: I98c49ad99d804242adaa7172de9e74337bdecda1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1016594, 925087
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874199Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708264}
parent b0578855
......@@ -425,17 +425,4 @@ TEST_F(OverviewButtonTrayTest, LeaveTabletModeBecauseExternalMouse) {
EXPECT_TRUE(GetTray()->GetVisible());
}
// Using the developers keyboard shortcut to enable tablet mode should force the
// overview tray button visible, even though the events are not blocked.
TEST_F(OverviewButtonTrayTest, ForDevTabletModeForcesTheButtonShown) {
Shell::Get()->tablet_mode_controller()->SetEnabledForDev(true);
EXPECT_TRUE(TabletModeControllerTestApi().IsTabletModeStarted());
EXPECT_FALSE(TabletModeControllerTestApi().AreEventsBlocked());
EXPECT_TRUE(GetTray()->GetVisible());
Shell::Get()->tablet_mode_controller()->SetEnabledForDev(false);
EXPECT_FALSE(TabletModeControllerTestApi().IsTabletModeStarted());
EXPECT_TRUE(GetTray()->GetVisible());
}
} // namespace ash
......@@ -184,9 +184,9 @@ constexpr TabletModeController::TabletModeBehavior kOnBySensor{
/*force_physical_tablet_state=*/false,
};
// Defines the behavior that sticks to tablet mode. Used to implement the
// --force-tablet-mode=touch_view flag.
constexpr TabletModeController::TabletModeBehavior kLockInTabletMode{
// Defines the behavior that sticks to the current mode. Used to
// implement --force-tablet-mode flag.
constexpr TabletModeController::TabletModeBehavior kLockInCurrentMode{
/*use_sensor=*/false,
/*observe_display_events=*/false,
/*observe_external_pointer_device_events=*/false,
......@@ -195,17 +195,6 @@ constexpr TabletModeController::TabletModeBehavior kLockInTabletMode{
/*force_physical_tablet_state=*/false,
};
// Defines the behavior that sticks to tablet mode. Used to implement the
// --force-tablet-mode=clamshell flag.
constexpr TabletModeController::TabletModeBehavior kLockInClamshellMode{
/*use_sensor=*/false,
/*observe_display_events=*/false,
/*observe_external_pointer_device_events=*/false,
/*block_internal_input_device=*/false,
/*always_show_overview_button=*/false,
/*force_physical_tablet_state=*/false,
};
// Defines the behavior used for testing. It prevents the device from
// switching the mode due to sensor events during the test.
constexpr TabletModeController::TabletModeBehavior kOnForTest{
......@@ -445,12 +434,8 @@ void TabletModeController::OnShellInitialized() {
forced_ui_mode_ = GetUiMode();
switch (forced_ui_mode_) {
case UiMode::kTabletMode:
tablet_mode_behavior_ = kLockInTabletMode;
UpdateUiTabletState();
break;
case UiMode::kClamshell:
tablet_mode_behavior_ = kLockInClamshellMode;
tablet_mode_behavior_ = kLockInCurrentMode;
UpdateUiTabletState();
break;
......@@ -921,17 +906,8 @@ void TabletModeController::UpdateInternalInputDevicesEventBlocker() {
tablet_mode_behavior_.block_internal_input_device &&
(InTabletMode() || is_in_tablet_physical_state_);
if (should_block_internal_events == AreInternalInputDeviceEventsBlocked()) {
if (tablet_mode_behavior_.always_show_overview_button) {
// The overview button visibility gets updated based on the
// OnTabletModeEventsBlockingChanged() notification. Broadcast this event
// if we need to force it visible.
for (auto& observer : tablet_mode_observers_)
observer.OnTabletModeEventsBlockingChanged();
}
if (should_block_internal_events == AreInternalInputDeviceEventsBlocked())
return;
}
event_blocker_->UpdateInternalInputDevices(should_block_internal_events);
for (auto& observer : tablet_mode_observers_)
......
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