Skip to content

Commit

Permalink
TabletModeController refacotring/simplification
Browse files Browse the repository at this point in the history
* Rename IsTabletModeWindowManagerEnabled -> InTabletMode
* Rename EnableTabletModeWindowManager -> EnableInternal private.
* Switched all EnableTabletmodeWindowManager usages in test to
  SetEnabledForTest/SetTabletEnabledForTest
* Removed kiosk_next_ flag. It uses force_ui_mode_ instead.
 (which I'll remove it next CL)

Bug: None
Change-Id: I0d6d66dcca5771b6617d39391000138c6de83217
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660794
Reviewed-by: Xiaoqian Dai <xdai@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Reviewed-by: Malay Keshav <malaykeshav@chromium.org>
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669773}
  • Loading branch information
mitoshima authored and Commit Bot committed Jun 17, 2019
1 parent 0d7e9be commit 9e05edd
Show file tree
Hide file tree
Showing 115 changed files with 393 additions and 526 deletions.
4 changes: 1 addition & 3 deletions ash/accelerators/accelerator_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1512,9 +1512,7 @@ void AcceleratorControllerImpl::PerformAction(
return;

if ((action == VOLUME_DOWN || action == VOLUME_UP) &&
Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled()) {
Shell::Get()->tablet_mode_controller()->InTabletMode()) {
if (ShouldSwapSideVolumeButtons(accelerator.source_device_id()))
action = action == VOLUME_DOWN ? VOLUME_UP : VOLUME_DOWN;

Expand Down
4 changes: 2 additions & 2 deletions ash/accelerators/accelerator_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ TEST_F(AcceleratorControllerTest, SideVolumeButtonLocation) {

// Tests the histogram of volume adjustment in tablet mode.
TEST_F(AcceleratorControllerTest, TabletModeVolumeAdjustHistogram) {
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
base::HistogramTester histogram_tester;
EXPECT_TRUE(
histogram_tester.GetAllSamples(kTabletCountOfVolumeAdjustType).empty());
Expand Down Expand Up @@ -1170,7 +1170,7 @@ class SideVolumeButtonAcceleratorTest

void SetUp() override {
AcceleratorControllerTest::SetUp();
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
test_api_->SetSideVolumeButtonLocation(region_, side_);
ui::DeviceDataManagerTestApi().SetUncategorizedDevices({ui::InputDevice(
kSideVolumeButtonId, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
Expand Down
3 changes: 1 addition & 2 deletions ash/accelerators/debug_commands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ void HandleToggleTouchscreen() {

void HandleToggleTabletMode() {
TabletModeController* controller = Shell::Get()->tablet_mode_controller();
controller->EnableTabletModeWindowManager(
!controller->IsTabletModeWindowManagerEnabled());
controller->SetEnabledForTest(!controller->InTabletMode());
}

void HandleTriggerCrash() {
Expand Down
4 changes: 1 addition & 3 deletions ash/accessibility/accessibility_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ void ShowAccessibilityNotification(A11yNotificationType type) {
text = l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_BRAILLE_DISPLAY_CONNECTED);
} else {
bool is_tablet = Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
bool is_tablet = Shell::Get()->tablet_mode_controller()->InTabletMode();

title = l10n_util::GetStringUTF16(
type == A11yNotificationType::kSpokenFeedbackBrailleEnabled
Expand Down
4 changes: 1 addition & 3 deletions ash/accessibility/key_accessibility_enabler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ KeyAccessibilityEnabler::~KeyAccessibilityEnabler() {
void KeyAccessibilityEnabler::OnKeyEvent(ui::KeyEvent* event) {
if ((event->type() != ui::ET_KEY_PRESSED &&
event->type() != ui::ET_KEY_RELEASED) ||
!Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled())
!Shell::Get()->tablet_mode_controller()->InTabletMode())
return;

if (event->key_code() == ui::VKEY_VOLUME_DOWN)
Expand Down
2 changes: 1 addition & 1 deletion ash/accessibility/key_accessibility_enabler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class KeyAccessibilityEnablerTest : public AshTestBase,
void SendKeyEvent(ui::KeyEvent* event) {
// Tablet mode gets exited elsewhere, so we must force it enabled before
// each key event.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
key_accessibility_enabler_->OnKeyEvent(event);
}

Expand Down
4 changes: 1 addition & 3 deletions ash/app_list/app_list_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ bool IsHomeScreenAvailable() {
}

bool IsTabletMode() {
return Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
return Shell::Get()->tablet_mode_controller()->InTabletMode();
}

// Close current Assistant UI.
Expand Down
14 changes: 6 additions & 8 deletions ash/app_list/app_list_controller_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ using ::app_list::kAppListTileLaunchIndexAndQueryLength;
using ::app_list::SearchResultLaunchLocation;

bool IsTabletMode() {
return Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
return Shell::Get()->tablet_mode_controller()->InTabletMode();
}

app_list::AppListView* GetAppListView() {
Expand Down Expand Up @@ -111,7 +109,7 @@ class AppListControllerImplTest : public AshTestBase {
// (see https://crbug.com/923089).
TEST_F(AppListControllerImplTest, UpdateExpandArrowViewVisibility) {
// Turn on the tablet mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
EXPECT_TRUE(IsTabletMode());

// No activatable windows. So hide the expand arrow view.
Expand Down Expand Up @@ -270,7 +268,7 @@ TEST_F(AppListControllerImplTest, CheckAppListViewBoundsWhenDismissVKeyboard) {
EXPECT_TRUE(GetVirtualKeyboardWindow()->IsVisible());

// Turn on the tablet mode. The virtual keyboard should still show.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
EXPECT_TRUE(IsTabletMode());
EXPECT_TRUE(GetVirtualKeyboardWindow()->IsVisible());

Expand Down Expand Up @@ -454,7 +452,7 @@ TEST_F(AppListControllerImplMetricsTest,
base::RunLoop().RunUntilIdle();

// Turn on the tablet mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
EXPECT_TRUE(IsTabletMode());

// Create a window then press the home launcher button. Expect that |w| is
Expand Down Expand Up @@ -527,7 +525,7 @@ TEST_F(AppListControllerImplMetricsTest,
base::RunLoop().RunUntilIdle();

// Turn on the tablet mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
EXPECT_TRUE(IsTabletMode());

// Create a window then press the home launcher button. Expect that |w| is
Expand All @@ -554,7 +552,7 @@ TEST_F(AppListControllerImplMetricsTest,
GetAppListView()->OnGestureEvent(&start_event);

// Turn off the tablet mode before scrolling is finished.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false);
EXPECT_FALSE(IsTabletMode());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(AppListViewState::kClosed, GetAppListView()->app_list_state());
Expand Down
10 changes: 5 additions & 5 deletions ash/app_list/app_list_metrics_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ TEST_F(AppListAppLaunchedMetricTest, ClosedLaunchFromShelf) {
// Test that the histogram records an app launch from the shelf while the
// homecher all apps state is showing.
TEST_F(AppListAppLaunchedMetricTest, HomecherAllAppsLaunchFromShelf) {
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
base::HistogramTester histogram_tester;

GetAppListTestHelper()->CheckState(ash::AppListViewState::kFullscreenAllApps);
Expand All @@ -413,7 +413,7 @@ TEST_F(AppListAppLaunchedMetricTest, HomecherAllAppsLaunchFromGrid) {
base::HistogramTester histogram_tester;

// Enable tablet mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
GetAppListTestHelper()->CheckState(ash::AppListViewState::kFullscreenAllApps);

PopulateAndLaunchAppInGrid();
Expand All @@ -431,7 +431,7 @@ TEST_F(AppListAppLaunchedMetricTest, HomecherAllAppsLaunchFromChip) {

GetAppListTestHelper()->WaitUntilIdle();
// Enable tablet mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
GetAppListTestHelper()->CheckState(ash::AppListViewState::kFullscreenAllApps);

PopulateAndLaunchSuggestionChip();
Expand All @@ -449,7 +449,7 @@ TEST_F(AppListAppLaunchedMetricTest, HomecherSearchLaunchFromShelf) {

// Enable tablet mode.
GetAppListTestHelper()->WaitUntilIdle();
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);

// Press a letter key, the AppListView should transition to kFullscreenSearch.
GetEventGenerator()->PressKey(ui::KeyboardCode::VKEY_H, 0);
Expand All @@ -471,7 +471,7 @@ TEST_F(AppListAppLaunchedMetricTest, HomecherSearchLaunchFromSearchBox) {

// Enable tablet mode.
GetAppListTestHelper()->WaitUntilIdle();
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);

// Press a letter key, the AppListView should transition to kFullscreenSearch.
GetEventGenerator()->PressKey(ui::KeyboardCode::VKEY_H, 0);
Expand Down
4 changes: 1 addition & 3 deletions ash/app_list/app_list_presenter_delegate_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ base::TimeDelta AppListPresenterDelegateImpl::GetVisibilityAnimationDuration(
}

bool AppListPresenterDelegateImpl::IsTabletMode() const {
return Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
return Shell::Get()->tablet_mode_controller()->InTabletMode();
}

app_list::AppListViewDelegate*
Expand Down
2 changes: 1 addition & 1 deletion ash/app_list/app_list_presenter_delegate_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void EnableTabletMode(bool enable) {
// again at the end of |TabletModeController::TabletModeController|.
base::RunLoop().RunUntilIdle();

Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(enable);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(enable);

// The app list will be shown automatically when tablet mode is enabled (Home
// launcher flag is enabled). Wait here for the animation complete.
Expand Down
4 changes: 1 addition & 3 deletions ash/assistant/assistant_interaction_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ constexpr int kWarmerWelcomesMaxTimesTriggered = 3;

// Returns true if device is in tablet mode, false otherwise.
bool IsTabletMode() {
return Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
return Shell::Get()->tablet_mode_controller()->InTabletMode();
}

} // namespace
Expand Down
4 changes: 1 addition & 3 deletions ash/assistant/assistant_view_delegate_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ bool AssistantViewDelegateImpl::IsLaunchWithMicOpen() const {
}

bool AssistantViewDelegateImpl::IsTabletMode() const {
return Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
return Shell::Get()->tablet_mode_controller()->InTabletMode();
}

void AssistantViewDelegateImpl::OnDialogPlateButtonPressed(
Expand Down
10 changes: 3 additions & 7 deletions ash/display/cros_display_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,8 @@ mojom::DisplayUnitInfoPtr GetDisplayUnitInfo(const display::Display& display,
bool has_accelerometer_support =
display.accelerometer_support() ==
display::Display::AccelerometerSupport::AVAILABLE;
info->is_tablet_mode =
has_accelerometer_support && Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
info->is_tablet_mode = has_accelerometer_support &&
Shell::Get()->tablet_mode_controller()->InTabletMode();
info->has_touch_support =
display.touch_support() == display::Display::TouchSupport::AVAILABLE;
info->has_accelerometer_support = has_accelerometer_support;
Expand Down Expand Up @@ -662,9 +660,7 @@ void CrosDisplayConfig::SetDisplayProperties(
if (properties->rotation) {
display::Display::Rotation rotation =
display::Display::Rotation(properties->rotation->rotation);
if (Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled() &&
if (Shell::Get()->tablet_mode_controller()->InTabletMode() &&
display.id() == display::Display::InternalDisplayId()) {
Shell::Get()->screen_orientation_controller()->SetLockToRotation(
rotation);
Expand Down
28 changes: 14 additions & 14 deletions ash/display/display_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3014,7 +3014,7 @@ TEST_F(DisplayManagerTest, UnifiedDesktopTabletMode) {

// Turn on tablet mode, expect that we switch to mirror mode without any
// crashes.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(display_manager()->IsInSoftwareMirrorMode());

Expand All @@ -3023,18 +3023,18 @@ TEST_F(DisplayManagerTest, UnifiedDesktopTabletMode) {
// asynchronously.
auto* app_list_controller = Shell::Get()->app_list_controller();
auto* tablet_mode_controller = Shell::Get()->tablet_mode_controller();
EXPECT_TRUE(tablet_mode_controller->IsTabletModeWindowManagerEnabled());
EXPECT_TRUE(tablet_mode_controller->InTabletMode());
EXPECT_TRUE(app_list_controller->IsVisible());

// Exiting tablet mode should exit mirror mode and return back to Unified
// mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false);
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(display_manager()->IsInSoftwareMirrorMode());
EXPECT_TRUE(display_manager()->IsInUnifiedMode());

// Home Launcher should be dismissed.
EXPECT_FALSE(tablet_mode_controller->IsTabletModeWindowManagerEnabled());
EXPECT_FALSE(tablet_mode_controller->InTabletMode());
EXPECT_FALSE(app_list_controller->IsVisible());
}

Expand All @@ -3055,7 +3055,7 @@ TEST_F(DisplayManagerTest, DisplayPrefsAndForcedMirrorMode) {

// Turn on tablet mode, and expect that it's not possible to persist the
// display prefs while forced mirror mode is active.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(display_manager()->IsInSoftwareMirrorMode());
EXPECT_TRUE(
Expand All @@ -3066,7 +3066,7 @@ TEST_F(DisplayManagerTest, DisplayPrefsAndForcedMirrorMode) {
EXPECT_TRUE(display_manager()->external_display_mirror_info().empty());

// Exit tablet mode and expect everything is back to normal.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false);
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(display_manager()->IsInSoftwareMirrorMode());
EXPECT_FALSE(
Expand Down Expand Up @@ -3616,7 +3616,7 @@ TEST_F(DisplayManagerOrientationTest, SaveRestoreUserRotationLock) {

EXPECT_EQ(0, test_observer.countAndReset());
// Just enabling will not save the lock.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
EXPECT_EQ(1, test_observer.countAndReset());

EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation());
Expand Down Expand Up @@ -3658,13 +3658,13 @@ TEST_F(DisplayManagerOrientationTest, SaveRestoreUserRotationLock) {
EXPECT_EQ(0, test_observer.countAndReset());

// Exit tablet mode reset to clamshell's rotation, which is 90.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false);
EXPECT_EQ(1, test_observer.countAndReset());
EXPECT_EQ(display::Display::ROTATE_270,
screen->GetPrimaryDisplay().rotation());
// Activate Any.
wm::ActivateWindow(window_a);
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
EXPECT_EQ(1, test_observer.countAndReset());
// Entering with active ANY will lock again to landscape.
EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation());
Expand Down Expand Up @@ -3709,7 +3709,7 @@ TEST_F(DisplayManagerOrientationTest, UserRotationLockReverse) {
display::Screen* screen = display::Screen::GetScreen();

// Just enabling will not save the lock.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);

orientation_controller->LockOrientationForWindow(
window, OrientationLockType::kPortrait);
Expand Down Expand Up @@ -3754,7 +3754,7 @@ TEST_F(DisplayManagerOrientationTest, LockToSpecificOrientation) {
OrientationLockType::kAny);
}
wm::ActivateWindow(window_a);
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);

orientation_controller->OnAccelerometerUpdated(portrait_primary);

Expand Down Expand Up @@ -3821,15 +3821,15 @@ TEST_F(DisplayManagerOrientationTest, DisplayChangeShouldNotSaveUserRotation) {
test_api.SetFirstDisplayAsInternalDisplay();
display::Screen* screen = display::Screen::GetScreen();

Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
// Emulate that Animator is calling this async when animation is completed.
display_manager->SetDisplayRotation(
screen->GetPrimaryDisplay().id(), display::Display::ROTATE_90,
display::Display::RotationSource::ACCELEROMETER);
EXPECT_EQ(display::Display::ROTATE_90,
screen->GetPrimaryDisplay().rotation());

Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false);
EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation());
}

Expand Down Expand Up @@ -4375,7 +4375,7 @@ TEST_F(DisplayManagerTest, SoftwareMirrorRotationForTablet) {
.SetFirstDisplayAsInternalDisplay();

// Simulate turning on mirror mode triggered by tablet mode on.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(display_manager()->IsInSoftwareMirrorMode());
EXPECT_EQ(gfx::Rect(0, 0, 400, 300),
Expand Down
4 changes: 2 additions & 2 deletions ash/display/display_prefs_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ TEST_F(DisplayPrefsTest, DontSaveTabletModeControllerRotations) {
ash::TabletModeController* controller =
ash::Shell::Get()->tablet_mode_controller();
controller->OnAccelerometerUpdated(update);
EXPECT_TRUE(controller->IsTabletModeWindowManagerEnabled());
EXPECT_TRUE(controller->InTabletMode());

// Trigger 90 degree rotation
update->Set(ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, false,
Expand Down Expand Up @@ -1011,7 +1011,7 @@ TEST_F(DisplayPrefsTest, LoadRotationNoLogin) {
ash::TabletModeController* tablet_mode_controller =
ash::Shell::Get()->tablet_mode_controller();
tablet_mode_controller->OnAccelerometerUpdated(update);
EXPECT_TRUE(tablet_mode_controller->IsTabletModeWindowManagerEnabled());
EXPECT_TRUE(tablet_mode_controller->InTabletMode());
bool screen_orientation_rotation_lock = IsRotationLocked();
display::Display::Rotation tablet_mode_rotation =
GetCurrentInternalDisplayRotation();
Expand Down
4 changes: 1 addition & 3 deletions ash/display/screen_orientation_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,7 @@ void ScreenOrientationController::UnlockAll() {
}

bool ScreenOrientationController::ScreenOrientationProviderSupported() const {
return Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
return Shell::Get()->tablet_mode_controller()->InTabletMode();
}

bool ScreenOrientationController::IsUserLockedOrientationPortrait() {
Expand Down
Loading

0 comments on commit 9e05edd

Please sign in to comment.