Cherry pick [Android] Override text handle visibility when the view is
detached

Bug: 18373995

Original Description:

PopupWindows are used to render text handles in WebView. As these popups
are drawn outside of the web contents View hierarchy, it's possible that
their visibility becomes unsynchronized with the WebView itself. For
example, after the WebView has been detached from the window but
before it has been properly disposed of. Address this by overriding
handle visibility when the (content) View is detached, restoring it
only after re-attachment.

BUG=430859
(internal b/18066784)

Change-Id: I43b5ff63368384c3ff30ceece7ddd86aa0a4b738
Committed: https://crrev.com/0563c2785d0b1e62793ffb0f9dc3ac178559aeaa
Cr-Commit-Position: refs/heads/master@{#303987}
8 files changed