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

Unified Diff: chrome/browser/translate/translate_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/translate/translate_infobar_delegate.cc
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc
index 5537e8343721bcaf13dc6b2369c36814b2126275..a5c3b7be5d2b47043043417e5f60415f6b151ca4 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -350,6 +350,16 @@ TranslateInfoBarDelegate::TranslateInfoBarDelegate(
}
}
+bool TranslateInfoBarDelegate::ShouldExpire(
+ const NavigationController::LoadCommittedDetails& details) const {
+ // Note: we allow closing this infobar even if the main frame navigation
+ // was programmatic and not initiated by the user - crbug.com/70261 .
MAD 2011/05/17 16:25:55 Remove extra space before '.'
+ if (!details.is_user_initiated_main_frame_load() && !details.is_main_frame)
+ return false;
+
+ return InfoBarDelegate::ShouldExpireInternal(details);
+}
+
void TranslateInfoBarDelegate::InfoBarDismissed() {
if (type_ != BEFORE_TRANSLATE)
return;

Powered by Google App Engine
This is Rietveld 408576698