cros: fix a crash that occurs after removing a user

Clicking on the "remove user" button the second time would trigger an animation
and then start tearing down the widget tree for the user to be removed (as well
as the user menu bubble). To prevent these two actions from racing, we
immediately hide the user menu widget before starting the teardown. We also
check the widget state early in key/mouse event handlers to prevent crashes
that could happen due to events on an orphaned view that hasn't been deleted
yet.

Bug: 912658
Change-Id: Iccefd785b5a7c8c97829e973bb4f132c406cf58f
Reviewed-on: https://chromium-review.googlesource.com/c/1379219
Reviewed-by: Jacob Dufault <jdufault@chromium.org>
Commit-Queue: Quan Nguyen <qnnguyen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616892}
2 files changed