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

Unified Diff: components/infobars/core/infobar_delegate.cc

Issue 1142153002: Simplify infobar expiry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android compile Created 5 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: components/infobars/core/infobar_delegate.cc
diff --git a/components/infobars/core/infobar_delegate.cc b/components/infobars/core/infobar_delegate.cc
index 84cd0e1015289851931785a27263b3765241c816..37fbdf79b09f6aeabf3cfedfcfd4b5af2a5aec33 100644
--- a/components/infobars/core/infobar_delegate.cc
+++ b/components/infobars/core/infobar_delegate.cc
@@ -41,10 +41,7 @@ bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
}
bool InfoBarDelegate::ShouldExpire(const NavigationDetails& details) const {
- if (!details.is_navigation_to_different_page)
- return false;
-
- return ShouldExpireInternal(details);
+ return details.is_navigation_to_different_page && !details.did_replace_entry;
}
void InfoBarDelegate::InfoBarDismissed() {
@@ -99,18 +96,7 @@ InfoBarDelegate::AsTranslateInfoBarDelegate() {
return nullptr;
}
-void InfoBarDelegate::StoreActiveEntryUniqueID() {
- contents_unique_id_ = infobar()->owner()->GetActiveEntryID();
-}
-
-InfoBarDelegate::InfoBarDelegate() : contents_unique_id_(0) {
-}
-
-bool InfoBarDelegate::ShouldExpireInternal(
- const NavigationDetails& details) const {
- // NOTE: If you change this, be sure to check and adjust the behavior of
- // anyone who overrides this as necessary!
- return (contents_unique_id_ != details.entry_id) || details.is_reload;
+InfoBarDelegate::InfoBarDelegate() {
}
} // namespace infobars

Powered by Google App Engine
This is Rietveld 408576698