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

Issue 1394473004: Fix favicon crash animation. (Closed)

Created:
5 years, 2 months ago by Peter Kasting
Modified:
5 years, 2 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, miu+watch_chromium.org, tapted
Base URL:
https://chromium.googlesource.com/chromium/src.git@cleanup
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix favicon crash animation. This fixes several problems with the code: * The code to animate the old favicon out of the tab was broken. The favicon offset needed to be applied unconditionally in PaintIcon(). * The favicon (old or new) could overlay the tabstrip/toolbar divider during the bottom part of the animation, looking glitchy. The favicon bounds needed to be clipped to the tab interior bounds. * The code that tried to reset the crash animation when the tab data state became uncrashed didn't work, because it only functioned when the data state was still "crashed". Besides this, since the code just deleted the animation instead of Stop()ing it, the override in the crash animation to reset the favicon offset to 0 wouldn't have run anyway. Fixed both of these issues, which otherwise would have resulted in the favicon being left at a nonzero offset if the tab became uncrashed mid-animation. This also cleans up a few things that will have little or no effect: * The distance to animate down (and back up) was hardcoded to 27. Compute this based on the tab interior height instead. Today that height is 23, which means the animation will appear to move slightly slower and spend less time "at the bottom". In the upcoming MD world, that height will be back to 27. * Removed most of the helper functions and inlined them into their callers, which helped with fixing some of the bugs above and made things shorter and more obvious overall. BUG=none TEST=Navigate to a site with a favicon. Use the omnibox to navigate the tab to chrome://crash then immediately switch to another tab. The original favicon should animate down out of the tab before the crashed favicon animates up, and at the bottom the icons should not overlay the tabstrip/toolbar divider. R=sky@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/110a79d6e0a74789779a749c165da155ce9bc440

Patch Set 1 #

Patch Set 2 : Cleanup helpers #

Total comments: 1

Patch Set 3 : Fix typo #

Patch Set 4 : Remove unnecessary conditional #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -56 lines) Patch
M chrome/browser/ui/views/tabs/tab.h View 1 1 chunk +3 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab.cc View 1 2 3 6 chunks +25 lines, -48 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 6 (1 generated)
Peter Kasting
tapted: Make sure this doesn't interact badly with https://codereview.chromium.org/1393193002/ , specifically because of the way ...
5 years, 2 months ago (2015-10-09 09:37:30 UTC) #2
Peter Kasting
Based on tapted's comments in https://codereview.chromium.org/1393193002/ , I removed the conditional I had added in ...
5 years, 2 months ago (2015-10-09 12:04:40 UTC) #3
sky
LGTM
5 years, 2 months ago (2015-10-09 16:51:59 UTC) #4
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/110a79d6e0a74789779a749c165da155ce9bc440 Cr-Commit-Position: refs/heads/master@{#353419}
5 years, 2 months ago (2015-10-09 23:21:48 UTC) #5
Peter Kasting
5 years, 2 months ago (2015-10-09 23:22:14 UTC) #6
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
110a79d6e0a74789779a749c165da155ce9bc440 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698