chromeos: Speculative fix for M69 shutdown crash in system tray

When the user clicks on the shutdown button in the system tray we start
a process that tears down ash::Shell and closes the tray bubble. This
dispatches mouse exit events to windows as the system is being torn
down. In production this sometimes crashes. I cannot repro on device,
on linux-chromeos, or under ASAN, using the M69 code.

The crash started after we turned off the new unified system tray
in M69, so it's likely related to the old system tray. It should
go away when we switch to the new tray.

As a workaround, skip dispatch of mouse exits during shutdown and
don't process any new events.

Bug: 874156
Test: manually exercise sign out and shutdown
Change-Id: Ic898d15270661b3275a4f396d154ad2c02ba0644
Reviewed-on: https://chromium-review.googlesource.com/1180070
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584324}
4 files changed