angler-fishThe Vulnerability History Project

[autofill] Avoid duplicate instances of the SaveCardBubble.

      autofill::SaveCardBubbleControllerImpl::ShowBubble() expects
(via DCHECK) to only be called when the save card bubble is
not already visible. This constraint is violated if the user
clicks multiple times on a submit button.

If the underlying page goes away, the last SaveCardBubbleView
created by the controller will be automatically cleaned up,
but any others are left visible on the screen... holding a
refence to a possibly-deleted controller.

This CL early exits the ShowBubbleFor*** and ReshowBubble logic
if the bubble is already visible.

BUG=708819

Review-Url: https://codereview.chromium.org/2862933002
Cr-Commit-Position: refs/heads/master@{#469768}
    
commit 8b457840e3512ef8c2af8d966a3edce5c653a835
-12
-56
expand_less