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

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

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

Description

Fix DCHECK in infobar animation. Solved in http://codereview.chromium.org/6788014/ Reason was traced down to OnBoundsChanged not getting called when the animation fired even when the infobar's preferred size should have changed. Thus Paint could get a different animation value from that of the previous animation value without the height being adjusted by Layout. I think this may be in the case where one infobar is opening when another is closing and the overall size of the infobar container is not changing, hence squelches layout propagation to its children. In addition, when extensions load, they call set_target_height, which doesn't cause Layout. As a hopefully less fragile alternative to plugging all of the places where Layout should be invalidated, I cache the height of the tab/bar along with the paths, so that whenever Paint occurs, it always goes against the last SetBounds values and doesn't have to recalculate based on animation, which may have progressed without causing a Layout and subsequent SetBounds. BUG=75451, 75450, 60990 TEST=browser_tests --gtest_filter=ExtensionApiTest.Infobars --gtest_repeat=100

Patch Set 1 #

Patch Set 2 : Alternative fix by caching tab/bar heights with the paths. #

Patch Set 3 : Added InvalidateLayout calls to animation and target_height changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -19 lines) Patch
M chrome/browser/extensions/extension_crash_recovery_browsertest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/extension_infobar_apitest.cc View 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/infobars/extension_infobar.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.h View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.cc View 1 2 6 chunks +25 lines, -12 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Sheridan Rawlins
Peter, can you take a look? Also see the temporary debugging logging http://code.google.com/p/chromium/issues/detail?id=75451#c13 which lead ...
9 years, 9 months ago (2011-03-30 01:18:20 UTC) #1
Sheridan Rawlins
There must be another case on the try servers... I'll add some logging there and ...
9 years, 9 months ago (2011-03-30 02:43:27 UTC) #2
Sheridan Rawlins
Peter, I like this fix better than the previous one - rather than trying to ...
9 years, 8 months ago (2011-03-30 19:58:08 UTC) #3
Peter Kasting
On 2011/03/30 19:58:08, Sheridan Rawlins wrote: > I like this fix better than the previous ...
9 years, 8 months ago (2011-03-30 20:07:23 UTC) #4
Sheridan Rawlins
Right - this DCHECK reveals places which were probably janky because they were not being ...
9 years, 8 months ago (2011-03-30 20:29:43 UTC) #5
Sheridan Rawlins
Added the InvalidateLayout in the SetTargetHeight, and AnimationProgressed methods to induce layout when our size ...
9 years, 8 months ago (2011-03-30 23:48:27 UTC) #6
Peter Kasting
9 years, 8 months ago (2011-04-01 17:06:22 UTC) #7
As promised, my version of this is in http://codereview.chromium.org/6788014/ . 
Feel free to close this if you like that better.

Powered by Google App Engine
This is Rietveld 408576698