From ec8f51164d477d8d83726fe61c68977d17b03149 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Tue, 8 Feb 2011 04:20:40 +0000 Subject: Cleanup: * Change int to size_t in a few APIs. * Rename infobar_delegate_count() to infobar_count() in preparation for TabContents owning InfoBars rather than InfoBarDelegates. * Move some code from PluginInstallerInfoBarDelegate to PluginObserver since it's more related to who's instantiating the infobar(delegate)s. * Unify InfoBarDelegate behavior by making no delegates auto-add themselves to tabs (callers now all do this explicitly). * Eliminate unused member TabContentsSSLHelper::SSLAddCertData::handler_. * De-inline a couple classes. * Make more functions private. * Add some consts. * Change DCHECK() to DCHECK_EQ() where possible. * Rename the delegates in plugin_observer.cc to have "Delegate" in the names. * Remove unnecessary qualifiers. * Simplify. * Misc. style issues, naming issues, etc. BUG=none TEST=none Review URL: http://codereview.chromium.org/6250172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74086 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/views/infobars/infobar_container.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'chrome/browser/ui/views/infobars/infobar_container.cc') diff --git a/chrome/browser/ui/views/infobars/infobar_container.cc b/chrome/browser/ui/views/infobars/infobar_container.cc index c829c14..b0c7f37 100644 --- a/chrome/browser/ui/views/infobars/infobar_container.cc +++ b/chrome/browser/ui/views/infobars/infobar_container.cc @@ -14,8 +14,6 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -// InfoBarContainer, public: --------------------------------------------------- - InfoBarContainer::InfoBarContainer(Delegate* delegate) : delegate_(delegate), tab_contents_(NULL) { @@ -62,14 +60,12 @@ void InfoBarContainer::RemoveDelegate(InfoBarDelegate* delegate) { void InfoBarContainer::PaintInfoBarArrows(gfx::Canvas* canvas, views::View* outer_view, int arrow_center_x) { - for(int i = 0; i < GetChildViewCount(); ++i) { + for (int i = 0; i < GetChildViewCount(); ++i) { InfoBarView* infobar = static_cast(GetChildViewAt(i)); infobar->PaintArrow(canvas, outer_view, arrow_center_x); } } -// InfoBarContainer, views::View overrides: ------------------------------------ - gfx::Size InfoBarContainer::GetPreferredSize() { // We do not have a preferred width (we will expand to fit the available width // of the delegate). Our preferred height is the sum of the preferred @@ -106,8 +102,6 @@ void InfoBarContainer::ViewHierarchyChanged(bool is_add, } } -// InfoBarContainer, NotificationObserver implementation: ---------------------- - void InfoBarContainer::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { @@ -124,10 +118,8 @@ void InfoBarContainer::Observe(NotificationType type, } } -// InfoBarContainer, private: -------------------------------------------------- - void InfoBarContainer::UpdateInfoBars() { - for (int i = 0; i < tab_contents_->infobar_delegate_count(); ++i) { + for (size_t i = 0; i < tab_contents_->infobar_count(); ++i) { InfoBarDelegate* delegate = tab_contents_->GetInfoBarDelegateAt(i); InfoBarView* infobar = static_cast(delegate->CreateInfoBar()); infobar->set_container(this); -- cgit v1.1