From 794c3bbd6ccf58b41be676607555b02cfacc71e3 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Sat, 22 Nov 2008 00:40:20 +0000 Subject: This change makes the following infobars use the new system: - save password Review URL: http://codereview.chromium.org/11559 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5882 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tab_contents.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'chrome/browser/tab_contents.cc') diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc index 510c611..20aa67b 100644 --- a/chrome/browser/tab_contents.cc +++ b/chrome/browser/tab_contents.cc @@ -390,7 +390,7 @@ void TabContents::SetInitialFocus() { void TabContents::AddInfoBar(InfoBarDelegate* delegate) { // Look through the existing InfoBarDelegates we have for a match. If we've // already got one that matches, then we don't add the new one. - for (size_t i = 0; i < infobar_delegate_count(); ++i) { + for (int i = 0; i < infobar_delegate_count(); ++i) { if (GetInfoBarDelegateAt(i)->EqualsDelegate(delegate)) return; } @@ -415,10 +415,10 @@ void TabContents::RemoveInfoBar(InfoBarDelegate* delegate) { find(infobar_delegates_.begin(), infobar_delegates_.end(), delegate); if (it != infobar_delegates_.end()) { InfoBarDelegate* delegate = *it; - infobar_delegates_.erase(it); NotificationService::current()->Notify(NOTIFY_TAB_CONTENTS_INFOBAR_REMOVED, Source(this), Details(delegate)); + infobar_delegates_.erase(it); } // Remove ourselves as an observer if we are tracking no more InfoBars. @@ -590,11 +590,9 @@ void TabContents::ExpireInfoBars( if (!details.is_user_initiated_main_frame_load()) return; - for (size_t i = 0; i < infobar_delegate_count(); ++i) { + for (int i = infobar_delegate_count() - 1; i >= 0; --i) { InfoBarDelegate* delegate = GetInfoBarDelegateAt(i); - if (!TransitionIsReload(details.entry->transition_type()) && - delegate->ShouldCloseOnNavigate()) { + if (delegate->ShouldCloseOnNavigate()) RemoveInfoBar(delegate); - } } } -- cgit v1.1