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

Unified Diff: chrome/browser/api/infobars/infobar_delegate.cc

Issue 11748012: Minor cleanup to how infobars handle expiry: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 12 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/api/infobars/infobar_delegate.cc
===================================================================
--- chrome/browser/api/infobars/infobar_delegate.cc (revision 174909)
+++ chrome/browser/api/infobars/infobar_delegate.cc (working copy)
@@ -98,18 +98,21 @@
: contents_unique_id_(0),
owner_(infobar_service) {
if (infobar_service)
- StoreActiveEntryUniqueID(infobar_service);
+ StoreActiveEntryUniqueID();
}
-void InfoBarDelegate::StoreActiveEntryUniqueID(
- InfoBarService* infobar_service) {
+void InfoBarDelegate::StoreActiveEntryUniqueID() {
+ content::WebContents* web_contents = owner_->GetWebContents();
+ DCHECK(web_contents);
NavigationEntry* active_entry =
- infobar_service->GetWebContents()->GetController().GetActiveEntry();
+ web_contents->GetController().GetActiveEntry();
contents_unique_id_ = active_entry ? active_entry->GetUniqueID() : 0;
}
bool InfoBarDelegate::ShouldExpireInternal(
const content::LoadCommittedDetails& 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->GetUniqueID()) ||
(content::PageTransitionStripQualifier(
details.entry->GetTransitionType()) ==
« no previous file with comments | « chrome/browser/api/infobars/infobar_delegate.h ('k') | chrome/browser/autofill/autofill_cc_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698