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

Unified Diff: chrome/browser/tab_contents/infobar_delegate.cc

Issue 6883299: Hide translate infobar on programmatic navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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: 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 7b4720eea85541154863ee981eaee5ce182502aa..5db9e637e2c3a8b9f13126974283bec65b936fdd 100644
--- a/chrome/browser/tab_contents/infobar_delegate.cc
+++ b/chrome/browser/tab_contents/infobar_delegate.cc
@@ -21,6 +21,12 @@ 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())
MAD 2011/05/02 19:18:02 Why not do this as part of another method, that on
+ return false;
+
return (contents_unique_id_ != details.entry->unique_id()) ||
(PageTransition::StripQualifier(details.entry->transition_type()) ==
PageTransition::RELOAD);

Powered by Google App Engine
This is Rietveld 408576698