Skip to content

Commit

Permalink
Reset tab-icon animations for loading -> waiting
Browse files Browse the repository at this point in the history
Prevents showing earlier favicon from the earlier page load that did not
finish (was still at loading). Also allows the favicon of the new page
load to fade in.

Bug: chromium:907642, chromium:910848
Change-Id: I65fb44b7f432d5a0f4cd484f5a497f9b8a327c62
Reviewed-on: https://chromium-review.googlesource.com/c/1361282
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613631}
  • Loading branch information
pbos authored and Commit Bot committed Dec 4, 2018
1 parent 14226ae commit 5964e26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chrome/browser/ui/views/tabs/tab_icon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,10 @@ void TabIcon::SetNetworkState(TabNetworkState network_state,
bool was_animated = NetworkStateIsAnimated(old_state);
bool is_animated = NetworkStateIsAnimated(network_state_);

if (!was_animated && is_animated) {
// Reset all animations.
// If we either start animating (or from loading to waiting), reset all
// animations.
if ((!was_animated && is_animated) ||
network_state_ == TabNetworkState::kWaiting) {
last_animation_update_time_ = clock_->NowTicks();
pending_animation_state_ = LoadingAnimationState();
pending_animation_state_.favicon_fade_in_progress.reset();
Expand Down

0 comments on commit 5964e26

Please sign in to comment.