m65 merge: cros: fix cannot minimize window after leaving tablet mode

changes:
When leaving tablet mode, we will restore old state, which will finally
call BaseState::UpdateMinimizedState. If a window is minimized at this
time, it will set |aura::client::kPreMinimizedShowStateKey| to
minimized show state. It doesn't make sense to set pre-minimized show
state to minimized show state, which could leave us in a bad window state.

TBR=jamescook@chromium.org

(cherry picked from commit b6f3f2bea1a5b9af6694611cc55c304de265956b)

Bug: 783310, 810857
Test: emulator test and added test coverage
Change-Id: I0c084774a838c0c0b9f3b516011ff31679ae770b
Reviewed-on: https://chromium-review.googlesource.com/914981
Commit-Queue: Qiang Xu <warx@google.com>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#536285}
Reviewed-on: https://chromium-review.googlesource.com/927357
Reviewed-by: Qiang Xu <warx@google.com>
Cr-Commit-Position: refs/branch-heads/3325@{#517}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
2 files changed