summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-22 00:40:20 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-22 00:40:20 +0000
commit794c3bbd6ccf58b41be676607555b02cfacc71e3 (patch)
tree8e2d6d434b84be183296fd2aca27c35df753ee6b /chrome/browser/tab_contents.cc
parentea9480ce469eb1db023c99b8af8e58f3d113b8d2 (diff)
downloadchromium_src-794c3bbd6ccf58b41be676607555b02cfacc71e3.zip
chromium_src-794c3bbd6ccf58b41be676607555b02cfacc71e3.tar.gz
chromium_src-794c3bbd6ccf58b41be676607555b02cfacc71e3.tar.bz2
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
Diffstat (limited to 'chrome/browser/tab_contents.cc')
-rw-r--r--chrome/browser/tab_contents.cc10
1 files changed, 4 insertions, 6 deletions
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<TabContents>(this),
Details<InfoBarDelegate>(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);
- }
}
}