Index: content/browser/tab_contents/tab_contents.cc |
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc |
index 02b63861cec2a743bbec06526d4d02d320fab3e2..a1dc3c8eb8adba32d07ef439497e7457b0269314 100644 |
--- a/content/browser/tab_contents/tab_contents.cc |
+++ b/content/browser/tab_contents/tab_contents.cc |
@@ -1209,17 +1209,17 @@ void TabContents::SetIsLoading(bool is_loading, |
void TabContents::ExpireInfoBars( |
const NavigationController::LoadCommittedDetails& details) { |
- // 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; |
+ bool non_user_initiated_load = !details.is_user_initiated_main_frame_load(); |
// NOTE: It is not safe to change the following code to count upwards or use |
// iterators, as the RemoveInfoBar() call synchronously modifies our delegate |
// list. |
for (size_t i = infobar_count(); i > 0; --i) { |
InfoBarDelegate* delegate = GetInfoBarDelegateAt(i - 1); |
+ if (non_user_initiated_load && |
MAD
2011/05/13 12:41:56
I think the coding style asks for {} when the cond
|
+ delegate->DoNotCloseOnProgrammaticNavigation()) |
brettw
2011/05/13 17:04:45
It's not clear why we need this extra function. Ca
|
+ continue; |
MAD
2011/05/13 12:41:56
Too much indent, should be brought back two spaces
|
+ |
if (delegate->ShouldExpire(details)) |
RemoveInfoBar(delegate); |
} |