[Media controls] Fix fullscreen orientation lock vs manifest lock
MediaControlsOrientationLockDelegate was releasing its fullscreen screen orientation lock when the device had been rotated to the match the orientation of the video (and other conditions were met). This was intended to have no immediate effect, and simply allow the user to exit fullscreen by rotating the device away. However it turns out that unlocking actually locks to the "default" orientation, and e.g. for an add-to-homescreen webapp that has set its manifest to portrait orientation, the "default" orientation would be portrait. So unlocking when in landscape would immediately rotate to portrait and exit fullscreen! This patch fixes that - instead of unlocking when the device orientation matches the video orientation, it locks to the "any" orientation which enables accelerometer-based screen orientation auto-rotation (overriding manifest orientations). A full unlock to "default" orientation happens later when fullscreen is exited. (To understand this, it's helpful to know that Chrome doesn't have a stack of orientation locks, it's simply last write wins, with the exception that ScreenOrientationProvider restores the manifest orientation when unlocking == locking to "default"). Bug: 740205 Change-Id: I590b33fa45a1ab6cc44ae3b49f983ae57d41a682 Reviewed-on: https://chromium-review.googlesource.com/577849Reviewed-by:Mounir Lamouri <mlamouri@chromium.org> Commit-Queue: John Mellor <johnme@chromium.org> Cr-Commit-Position: refs/heads/master@{#488229}
Showing
Please register or sign in to comment