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

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: Update testcase. 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: 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);

Powered by Google App Engine
This is Rietveld 408576698