summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/collected_cookies_infobar_delegate.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 02:12:10 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 02:12:10 +0000
commite3c31d27e49dd4b795fdca9c290fabee1b117b02 (patch)
treec5b4d960ae0237842d77324542b205e80d4dfcbf /chrome/browser/ui/collected_cookies_infobar_delegate.cc
parentf9486289464b51ffedba0541bf0fbeefc5d53f39 (diff)
downloadchromium_src-e3c31d27e49dd4b795fdca9c290fabee1b117b02.zip
chromium_src-e3c31d27e49dd4b795fdca9c290fabee1b117b02.tar.gz
chromium_src-e3c31d27e49dd4b795fdca9c290fabee1b117b02.tar.bz2
Replace the virtual InfoBarDelegate::InfoBarClosed() function with a non-virtual one. This is a step along the way to killing it entirely. This also adds a lot of OVERRIDE markers and does some other cleanup in a few places.
The original (stupid) design for the delegate class left subclasses great flexibility in how they mapped infobars to delegates. In practice, no one ever wanted multiple infobars driven off a single delegate, so the mapping was always one-to-one. As a result, it was always correct for InfoBarClosed() to "delete this", but because the base class did not do so, every subclass needed to. Most did; the others leaked memory and failed to run their destructors. This change forces the base class to delete itself. This fixes the delegate leaks in the couple subclasses that failed to do this. It also eliminates a lot of copy-and-pasted "delete this" implementations. Ultimately, we'll be moving to a model where the InfoBar "view" class owns the delegate and deletes it directly, which will eliminate InfoBarClosed() completely. BUG=62154 TEST=none Review URL: http://codereview.chromium.org/6926001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84195 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/collected_cookies_infobar_delegate.cc')
-rw-r--r--chrome/browser/ui/collected_cookies_infobar_delegate.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/ui/collected_cookies_infobar_delegate.cc b/chrome/browser/ui/collected_cookies_infobar_delegate.cc
index 9c503a7..5e97a7d 100644
--- a/chrome/browser/ui/collected_cookies_infobar_delegate.cc
+++ b/chrome/browser/ui/collected_cookies_infobar_delegate.cc
@@ -34,8 +34,8 @@ int CollectedCookiesInfoBarDelegate::GetButtons() const {
return BUTTON_OK;
}
-string16 CollectedCookiesInfoBarDelegate::GetButtonLabel(InfoBarButton button)
- const {
+string16 CollectedCookiesInfoBarDelegate::GetButtonLabel(
+ InfoBarButton button) const {
DCHECK_EQ(BUTTON_OK, button);
return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_BUTTON);
}