Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(770)

Issue 8698016: Remove InfoBarDelegate::InfoBarClosed(), delete InfoBars directly. (Closed)

Created:
9 years ago by marja
Modified:
9 years ago
CC:
chromium-reviews, Avi (use Gerrit), creis+watch_chromium.org, brettw-cc_chromium.org, Paweł Hajdan Jr., rdsmith+dwatch_chromium.org, ajwong+watch_chromium.org
Visibility:
Public.

Description

Remove InfoBarDelegate::InfoBarClosed(), delete InfoBars directly. Later I'd like to add a virtual InfoBarDelegate::InfoBarClosed() which subclasses can override to receive an event when the infobar is hidden. BUG=NONE TEST=NONE

Patch Set 1 #

Total comments: 5

Patch Set 2 : Code review comments + mac build fixes. #

Patch Set 3 : Cancelling changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -33 lines) Patch
M chrome/browser/download/download_request_infobar_delegate_unittest.cc View 1 chunk +1 line, -6 lines 0 comments Download
M chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc View 10 chunks +12 lines, -12 lines 0 comments Download
M chrome/browser/infobars/infobar.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/infobars/infobar.cc View 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/infobars/infobar_delegate.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/infobars/infobar_delegate.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/infobars/infobar_tab_helper.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/confirm_infobar_delegate.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/infobars/infobar_controller.mm View 1 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
jochen (gone - plz use gerrit)
http://codereview.chromium.org/8698016/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc File chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc (right): http://codereview.chromium.org/8698016/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc#newcode234 chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc:234: delete infobar_0; since the infobar owns the delegate, shouldn't ...
9 years ago (2011-11-28 08:36:23 UTC) #1
marja
Thanks for comments! http://codereview.chromium.org/8698016/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc File chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc (right): http://codereview.chromium.org/8698016/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc#newcode234 chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc:234: delete infobar_0; On 2011/11/28 08:36:23, jochen ...
9 years ago (2011-11-28 09:40:30 UTC) #2
marja
http://codereview.chromium.org/8698016/diff/1/chrome/browser/infobars/infobar.cc File chrome/browser/infobars/infobar.cc (right): http://codereview.chromium.org/8698016/diff/1/chrome/browser/infobars/infobar.cc#newcode57 chrome/browser/infobars/infobar.cc:57: InfoBar::~InfoBar() { On 2011/11/28 09:40:30, marja wrote: > On ...
9 years ago (2011-11-28 15:50:36 UTC) #3
jochen (gone - plz use gerrit)
9 years ago (2011-11-28 15:51:59 UTC) #4
On 2011/11/28 15:50:36, marja wrote:
>
http://codereview.chromium.org/8698016/diff/1/chrome/browser/infobars/infobar.cc
> File chrome/browser/infobars/infobar.cc (right):
> 
>
http://codereview.chromium.org/8698016/diff/1/chrome/browser/infobars/infobar...
> chrome/browser/infobars/infobar.cc:57: InfoBar::~InfoBar() {
> On 2011/11/28 09:40:30, marja wrote:
> > On 2011/11/28 08:36:24, jochen wrote:
> > > I wonder whether we should delete the delegate here as well, to be on the
> safe
> > > side.
> > 
> > Done. (I made delegate_ a scoped_ptr.)
> 
> Ouch, this was the wrong thing to do. InfoBarContainer accesses the
> InfoBarDelegate after InfoBar has been destroyed. I cancelled that change. The
> ownership of InfoBarDelegate is not very clear; I tried not to change it in
this
> CL but only replace this InfoBarClosed function with direct deletion (whoever
is
> doing the deleting). Is that ok?

ok :-/

Powered by Google App Engine
This is Rietveld 408576698