Fix a lifetime issue in ToolbarActionsBarBubbleViews.

Also re-enable
ExtensionMessageBubbleViewBrowserTest.TestClickingLearnMoreButton on
Mac, which tickled it, and add more coverage.

The test was disabled on Mac in r457730, but the crash reporter has
matching stacks recorded on Windows - see http://crbug.com/702554#c6.

The problem is that clicking a button would trigger an asynchronous
Widget::Close() after setting the view's delegate to null. But OS events
can still arrive while waiting for the asynchronous Close() to complete,
and cause a segfault.

To fix, don't clear the view's delegate: just set state to ensure the
correct close reason is forwarded to it when the dialog is closed via
the usual codepaths.

BUG=702554

Review-Url: https://codereview.chromium.org/2762893002
Cr-Commit-Position: refs/heads/master@{#459382}
3 files changed