summaryrefslogtreecommitdiffstats
path: root/chrome/browser/geolocation
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/geolocation
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/geolocation')
-rw-r--r--chrome/browser/geolocation/geolocation_permission_context.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc
index 71d03d6..200b3c3 100644
--- a/chrome/browser/geolocation/geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context.cc
@@ -125,15 +125,14 @@ class GeolocationConfirmInfoBarDelegate : public ConfirmInfoBarDelegate {
virtual ~GeolocationConfirmInfoBarDelegate();
// ConfirmInfoBarDelegate:
- virtual void InfoBarClosed();
- virtual gfx::Image* GetIcon() const;
- virtual Type GetInfoBarType() const;
- virtual string16 GetMessageText() const;
- virtual string16 GetButtonLabel(InfoBarButton button) const;
- virtual bool Accept();
- virtual bool Cancel();
- virtual string16 GetLinkText();
- virtual bool LinkClicked(WindowOpenDisposition disposition);
+ virtual gfx::Image* GetIcon() const OVERRIDE;
+ virtual Type GetInfoBarType() const OVERRIDE;
+ virtual string16 GetMessageText() const OVERRIDE;
+ virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
+ virtual bool Accept() OVERRIDE;
+ virtual bool Cancel() OVERRIDE;
+ virtual string16 GetLinkText() OVERRIDE;
+ virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
TabContents* tab_contents_;
GeolocationInfoBarQueueController* controller_;
@@ -165,12 +164,8 @@ GeolocationConfirmInfoBarDelegate::GeolocationConfirmInfoBarDelegate(
}
GeolocationConfirmInfoBarDelegate::~GeolocationConfirmInfoBarDelegate() {
-}
-
-void GeolocationConfirmInfoBarDelegate::InfoBarClosed() {
controller_->OnInfoBarClosed(render_process_id_, render_view_id_,
bridge_id_);
- delete this;
}
gfx::Image* GeolocationConfirmInfoBarDelegate::GetIcon() const {