[AF] Cleanup rows when the popup is hidden

This fixes a flaky test on ChromeOS, in which a mouse exit event can be
received by a row after the popup is hidden (in the test in case, this
happened when the frame that contained the dropdown was deleted).

The solution here consists of not giving rows direct access to the
controller; now they need to use an accessor method in the native view,
which will return nullptr after the popup is hidden.

As a safety measure, also protected other accesses to the controller,
except on CreateContent(), which is called when a row is being created,
and the controller's existence is guaranteed.

Bug: 864477
Change-Id: I8be9be974065543ca9da6ea165365ed7777e70b7
Reviewed-on: https://chromium-review.googlesource.com/1140284
Commit-Queue: Fabio Tirelo <ftirelo@chromium.org>
Reviewed-by: Tommy Martino <tmartino@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575739}
2 files changed