[merge-m59] Cater for the "double close" when clicking "Learn More" on auto-dismiss extension bubbles.

This fixes a regression from r459382 where clicking a "Learn More" link
on the NTP override bubble can spew out tabs. The problem is that
opening a tab may defocus the bubble, triggering a Close(). The
extension bubble client must still call close since there's no guarantee
that the defocus may trigger a close.

To fix, Close() needs more awareness of whether it is closed via being
deactivated by the user, via being deactivated by the delegate opening a
link, or via being explicitly closed by LinkClicked(). Currently it only
caters for two of these cases. We can more clearly capture the use case
simply by ensuring the delegate is not notified multiple times by
setting a flag.

BUG=712545
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
TBR=tapted@chromium.org

Review-Url: https://codereview.chromium.org/2827603005
Cr-Commit-Position: refs/heads/master@{#466228}
(cherry picked from commit d7340b19e7dd13c8379174ad50ce2c8220637aa7)

Review-Url: https://codereview.chromium.org/2830163003
Cr-Commit-Position: refs/branch-heads/3071@{#144}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}
5 files changed