Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4969)

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 6883299: Hide translate infobar on programmatic navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Less invasive change Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698