• Ahmed Fakhry's avatar
    TabletModeController: Refactor and Cleanup. · d25bdaaa
    Ahmed Fakhry authored
    - Remove Attempt Enter/Leave TabletMode() which was scattered
      and used all over the place.
    - Make a clear distinction between a device physical tablet
      state (which is affected by device events such as lid angle
      changes, tablet EC switches, ... etc.) and a UI tablet state
      (which is whether the UI is currently in tablet or clamshell
       modes).
    - Gather all the inconsistent and scattered logic that affects
      the device and UI states into consolidated, and clear functions
      that get invoked whenever the state needs to be updated.
    
    This CL is a prerequisite work for the auto-rotation work
    coming up soon.
    
    BUG=925087
    TEST=No behavior change, all tests must pass.
    
    Change-Id: If4c2777f434a09f3c70b32bb60367cfb118102b9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1851286
    Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
    Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#704975}
    d25bdaaa
tablet_mode_controller.cc 40.7 KB