Don't let navigation dismiss infobars added during that navigation.
commitf9fec9942a46dfa0242b9a03ce515d9ace75ea7e
authorpkasting <pkasting@chromium.org>
Thu, 2 Jul 2015 07:59:09 +0000 (2 00:59 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 2 Jul 2015 07:59:43 +0000 (2 07:59 +0000)
treeb8575204008757476f1cc3a8bd1a11414c738836
parent681973dc83ad56b14f1ed606d28b588ce1ba19bd
Don't let navigation dismiss infobars added during that navigation.

Turns out my reasoning on https://codereview.chromium.org/1142153002/ was
incorrect, and the unique ID check there was doing something after all.
Specifically, if you add an infobar while a navigation is pending, then when the
navigation commits, it will remove the infobar again (unless this check is
re-added).

This patch restores that check.

Note that the behavior now is still not quite what it was before this whole
cleanup began; we're now a bit more conservative on various infobars that used
to override ShouldExpireInternal(), in that we now run this ID check when we
didn't then.  I think that's fine, arguably more correct.

BUG=492610
TEST=Run chrome, force it to crash, relaunch with --disable-session-crashed-bubble, ensure you get a "session crashed" infobar and it is not auto-dismissed
TBR=droger

Review URL: https://codereview.chromium.org/1215053007

Cr-Commit-Position: refs/heads/master@{#337187}
chrome/browser/infobars/infobar_service.cc
components/infobars/core/infobar.cc
components/infobars/core/infobar.h
components/infobars/core/infobar_delegate.cc
components/infobars/core/infobar_delegate.h
ios/chrome/browser/infobars/infobar_manager_impl.cc