Revert "Fix a crash when switching to tablet mode in Unified Desktop mode"

This reverts commit dcb55ce2871fe258d30386a85af754d496dfdb62.

Reason for revert: Appears to cause crashes in LoginCursorTest.CursorHidden. See
BrowserTestBase received signal: Segmentation fault. Backtrace:
#0 0x55c75309100f base::debug::StackTrace::StackTrace()
#1 0x55c752aa8075 content::(anonymous namespace)::DumpStackTraceSignalHandler()
#2 0x7f17e8b21cb0 <unknown>
#3 0x55c751991a1d chromeos::OobeUIDialogDelegate::~OobeUIDialogDelegate()
#4 0x55c751991c8e chromeos::OobeUIDialogDelegate::~OobeUIDialogDelegate()
#5 0x55c7553a6063 views::WebDialogView::OnDialogClosed()
#6 0x55c7553a5d92 views::WebDialogView::WindowClosing()
#7 0x55c752f81eb0 views::Widget::OnNativeWidgetDestroying()
#8 0x55c7548080ff views::DesktopWindowTreeHostMus::CloseNow()

Original change's description:
> Fix a crash when switching to tablet mode in Unified Desktop mode
> 1) The Home Launcher used to use the wrong display ID when in
>    Unified Desktop mode.
> 2) If (1) is fixed, we hit The captive
>    portal dialog widget used to be leaked and never destroyed.
> 3) If (2) is fixed, we crash on the first attempt to press the
>    app list button. The reason is tablet mode triggers a switch
>    to mirror mode. This switch happens asynchronously after the
>    Home Launcher had already been created. Switching from Unified
>    to mirror mode destroys the Unified host and the Home Launcher.
>    That's why we need to ensure that the Home Launcher is
>    recreated.
> BUG=900956, 902601
> TEST=Added a test that crashes without the fix.
> Change-Id: If6eb9c2255dfa9d442aa115a3274db2d8a4110d7
> Reviewed-on:
> Commit-Queue: Ahmed Fakhry <>
> Reviewed-by: Weidong Guo <>
> Reviewed-by: Xiyuan Xia <>
> Reviewed-by: Jacob Dufault <>
> Reviewed-by: Mitsuru Oshima <>
> Cr-Commit-Position: refs/heads/master@{#606687},,,,

Change-Id: I2e0cacc2c29bbc44e8e8c9dfcb86fd8106c008ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 900956, 902601
Reviewed-by: Patrik Höglund <>
Commit-Queue: Patrik Höglund <>
Cr-Commit-Position: refs/heads/master@{#606808}
5 files changed