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

Issue 6788014: Fix DCHECK() in infobar animation. (Closed)

Created:
9 years, 8 months ago by Peter Kasting
Modified:
9 years, 7 months ago
Reviewers:
Sheridan Rawlins, sky
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Fix DCHECK() in infobar animation. The core of the problem here is that painting does not always happen synchronously with layout, and the old code was not always forcing re-layout to occur if the animation progressed in the meantime. This change forces re-layout to occur any time the animation progresses or the target height is changed, and makes that the one time when the tab and bar heights are recalculated -- all other places then use the calculated values. This also tweaks which functions are in the cross-platform versus platform-specific code as well as making a few other small cleanups. Finally, this re-enables a test on Mac that seems to be passing now. BUG=60990, 75451 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=80272

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 9

Patch Set 4 : '' #

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -124 lines) Patch
M chrome/browser/extensions/extension_crash_recovery_browsertest.cc View 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/extensions/extension_infobar_apitest.cc View 1 2 2 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/external_tab_container_win.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/external_tab_container_win.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view_layout.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/infobars/extension_infobar.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar.h View 1 2 3 1 chunk +8 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar.cc View 1 2 3 2 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_container.h View 1 2 3 3 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_container.cc View 1 2 3 2 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_container_view.h View 2 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_container_view.cc View 3 chunks +7 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.h View 1 2 3 5 chunks +10 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.cc View 1 2 3 4 7 chunks +77 lines, -69 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Peter Kasting
This is my take on Sheridan's http://codereview.chromium.org/6675033/ . It's broadly similar, but makes some changes ...
9 years, 8 months ago (2011-04-01 17:05:20 UTC) #1
Sheridan Rawlins
Does animation Reset need attention too? http://codesearch.google.com/codesearch/p?hl=en#OAMlx_jo-ck/src/chrome/browser/ui/views/infobars/translate_infobar_base.cc&q=animation_-%3EReset&exact_package=chromium&l=69 http://codesearch.google.com/codesearch/p?hl=en#OAMlx_jo-ck/src/chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.cc&q=animation_-%3EReset&exact_package=chromium&l=46 http://codereview.chromium.org/6788014/diff/5002/chrome/browser/extensions/extension_infobar_apitest.cc File chrome/browser/extensions/extension_infobar_apitest.cc (right): http://codereview.chromium.org/6788014/diff/5002/chrome/browser/extensions/extension_infobar_apitest.cc#newcode9 chrome/browser/extensions/extension_infobar_apitest.cc:9: #if ...
9 years, 8 months ago (2011-04-01 18:41:48 UTC) #2
Peter Kasting
I don't understand your animation Reset() question. Reset() is only called in InfoBar functions, which ...
9 years, 8 months ago (2011-04-01 19:07:15 UTC) #3
Peter Kasting
New patch up. The previous patch had two problems: * The |fill_path| calculation relied on ...
9 years, 8 months ago (2011-04-01 20:29:16 UTC) #4
Sheridan Rawlins
Regarding the animation Reset calls the links I sent were from two files related to ...
9 years, 8 months ago (2011-04-01 20:36:56 UTC) #5
Sheridan Rawlins
On 2011/04/01 20:29:16, Peter Kasting wrote: > Both problems were fixed by moving the path ...
9 years, 8 months ago (2011-04-01 20:38:41 UTC) #6
Peter Kasting
On 2011/04/01 20:36:56, Sheridan Rawlins wrote: > Regarding the animation Reset calls the links I ...
9 years, 8 months ago (2011-04-01 20:48:09 UTC) #7
Sheridan Rawlins
9 years, 8 months ago (2011-04-02 00:58:25 UTC) #8
Thanks for looking into and allaying my concerns.

LGTM.

On 2011/04/01 20:48:09, Peter Kasting wrote:
> On 2011/04/01 20:36:56, Sheridan Rawlins wrote:
> > Regarding the animation Reset calls the links I sent were from two files
> related
> > to translation infobars, which don't look like they cause Layout afterwards.
> 
> Sorry, I missed the links (scanned past them as my eye assumed they were
> codereview links).  Those calls reset the background color animation, which is
a
> totally different animation that doesn't have any effect on the infobar size.
> 
> On 2011/04/01 20:38:41, Sheridan Rawlins wrote:
> > On 2011/04/01 20:29:16, Peter Kasting wrote:
> > > Both problems were fixed by moving the path calculations to Layout(),
which
> is
> > a
> > > reasonable place to set the paths anyway.
> > 
> > I still don't get why OnBoundsChanged is not the appropriate place to adjust
> > paths/heights.  Isn't that method the definitive moment at which your sizes
> are
> > actually changed (as opposed to the other calls which are asking essentially
> for
> > preferred values?
> 
> There's little practical difference between doing this in OnBoundsChanged()
and
> Layout().  Doing it in Layout() has three small advantages:
> * It's more consistent with how most of the rest of the codebase works --
> generally, we do all recalculations related to bounds in Layout() functions. 
> OnBoundsChanged() is more special-purpose.  sky can correct me if I'm wrong
> here.
> * Because we need to lay out the infobar contents in Layout(), this puts all
of
> the layout-related changes in one function instead of split in two.
> * Related: We avoid having to override more of the API calls.

Powered by Google App Engine
This is Rietveld 408576698