Entering Docked Mode (external display attached, lid shut) causes incorrect display rotations to persist when the internal display is reactivated.
Two current situations lead to this.
1) Docked mode recreates large portions of ash::Shell, so classes reacting to lid closures never execute this logic. As far as they know the lid is open. They then try to apply changes to an inactive display. They are never told to reapply them.
2) The internal display is deactivated, however it's active rotation is never reset. Upon reactivating the window the invalid active rotation is re-applied.
This change has DisplayManager reset the active rotation of the internal display upon its deactivation.
Additionally rotations applied to an inactive display are set on the display info so that they can be applied when the window is reactivated.
TEST=DisplayManagerTest.Rotate
BUG=chrome-os-partner:38778, 480703
Review URL: https://codereview.chromium.org/
1162603008
Cr-Commit-Position: refs/heads/master@{#332392}