Chromium Code Reviews| Index: chrome/browser/tab_contents/infobar_delegate.cc |
| diff --git a/chrome/browser/tab_contents/infobar_delegate.cc b/chrome/browser/tab_contents/infobar_delegate.cc |
| index d0b04b7af1d027879735688e938339a345ec7936..38756448f8c12e26ba96b6bee4ec7f22bb822c55 100644 |
| --- a/chrome/browser/tab_contents/infobar_delegate.cc |
| +++ b/chrome/browser/tab_contents/infobar_delegate.cc |
| @@ -21,6 +21,17 @@ bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { |
| bool InfoBarDelegate::ShouldExpire( |
| const NavigationController::LoadCommittedDetails& details) const { |
| + // Only hide InfoBars when the user has done something that makes the main |
| + // frame load. We don't want various automatic or subframe navigations making |
| + // it disappear. |
| + if (!details.is_user_initiated_main_frame_load()) |
| + return false; |
|
MAD
2011/05/17 16:25:55
Too much indent...
|
| + |
| + return ShouldExpireInternal(details); |
| +} |
| + |
| +bool InfoBarDelegate::ShouldExpireInternal( |
| + const NavigationController::LoadCommittedDetails& details) const { |
| return (contents_unique_id_ != details.entry->unique_id()) || |
| (PageTransition::StripQualifier(details.entry->transition_type()) == |
| PageTransition::RELOAD); |