• Jun Mukai's avatar
    Refine ForceUiTabletModeState · be77d98e
    Jun Mukai authored
    Previously, ForceUiTabletModeState uses kLockInTabletMode and
    kLockInClamshellMode, and use forced_ui_mode_ to enforce the
    tablet-mode state. However, this turns out not correct on
    the handling of screen_orientation_controller.
    
    To make ScreenOrientationController (and maybe some other entities)
    work with testing situation, ForceUiTabletModeState should set
    is_in_tablet_physical_state flag.
    
    In this CL:
    - change a simple 'force_physical_tablet_state' boolean to tri-state.
    - introduce new TabletModeBehaviors for the new states.
    - since it is considered to be 'physically tablet' status but
      we don't want to auto-rotate the screen due to accelerometer,
      create a new callback and add a mechanism to suppress the auto
      rotation.
    
    This CL does not change all existing ash unit tests -- that will be done
    in another CL.
    
    Bug: b/161253230
    Test: ScreenOrientationControllerTest, tast arc.WMNonresizableConversion, make sure the screen orientation
    Change-Id: Ic48f8570df103fe58336faa675f9c1753bb63ee8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310773
    Commit-Queue: Jun Mukai <mukai@chromium.org>
    Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
    Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#791319}
    be77d98e
screen_orientation_controller_unittest.cc 44 KB