Chromium Code Reviews| Index: chrome/browser/ui/views/tabs/tab.cc |
| =================================================================== |
| --- chrome/browser/ui/views/tabs/tab.cc (revision 184455) |
| +++ chrome/browser/ui/views/tabs/tab.cc (working copy) |
| @@ -512,22 +512,27 @@ |
| } |
| } else if ((data_.capture_state == TabRendererData::CAPTURE_STATE_NONE) && |
| (old.capture_state != TabRendererData::CAPTURE_STATE_NONE)) { |
| - StopRecordingAnimation(); |
| + StopIconAnimation(); |
| } else if ((data_.capture_state != TabRendererData::CAPTURE_STATE_NONE) && |
| (old.capture_state == TabRendererData::CAPTURE_STATE_NONE)) { |
| StartRecordingAnimation(); |
| - } else if ((data_.audio_state == TabRendererData::AUDIO_STATE_NONE) && |
| - (old.audio_state != TabRendererData::AUDIO_STATE_NONE)) { |
| - StopAudioPlayingAnimation(); |
| - } else if ((data_.audio_state != TabRendererData::AUDIO_STATE_NONE) && |
| - (old.audio_state == TabRendererData::AUDIO_STATE_NONE)) { |
| - StartAudioPlayingAnimation(); |
| } else { |
| if (IsPerformingCrashAnimation()) |
| - StopCrashAnimation(); |
| + StopIconAnimation(); |
| ResetCrashedFavicon(); |
| } |
| + // Don't clobber the recording or projecting animation for audio indicator. |
| + if (data_.capture_state == TabRendererData::CAPTURE_STATE_NONE) { |
| + if ((data_.audio_state == TabRendererData::AUDIO_STATE_NONE) && |
| + (old.audio_state != TabRendererData::AUDIO_STATE_NONE)) { |
| + StopIconAnimation(); |
| + } else if ((data_.audio_state != TabRendererData::AUDIO_STATE_NONE) && |
| + (old.audio_state == TabRendererData::AUDIO_STATE_NONE)) { |
| + StartAudioPlayingAnimation(); |
| + } |
| + } |
| + |
| if (old.mini != data_.mini) { |
| if (tab_animation_.get() && tab_animation_->is_animating()) { |
| tab_animation_->Stop(); |
| @@ -1595,17 +1600,18 @@ |
| should_display_crashed_favicon_ = false; |
| } |
| -void Tab::StartCrashAnimation() { |
| - icon_animation_.reset(new FaviconCrashAnimation(this)); |
| - icon_animation_->Start(); |
| -} |
| - |
| -void Tab::StopCrashAnimation() { |
| +void Tab::StopIconAnimation() { |
| if (!icon_animation_.get()) |
| return; |
| + icon_animation_->Stop(); |
|
sky
2013/02/25 22:58:12
Do you need the Stop()? Can this just reset()?
|
| icon_animation_.reset(); |
| } |
| +void Tab::StartCrashAnimation() { |
| + icon_animation_.reset(new FaviconCrashAnimation(this)); |
| + icon_animation_->Start(); |
| +} |
| + |
| void Tab::StartRecordingAnimation() { |
| ui::ThrobAnimation* animation = new ui::ThrobAnimation(this); |
| animation->SetTweenType(ui::Tween::EASE_IN_OUT); |
| @@ -1614,13 +1620,6 @@ |
| icon_animation_.reset(animation); |
| } |
| -void Tab::StopRecordingAnimation() { |
| - if (!icon_animation_.get()) |
| - return; |
| - icon_animation_->Stop(); |
| - icon_animation_.reset(); |
| -} |
| - |
| void Tab::StartAudioPlayingAnimation() { |
| ui::ThrobAnimation* animation = new ui::ThrobAnimation(this); |
| animation->SetTweenType(ui::Tween::LINEAR); |
| @@ -1629,13 +1628,6 @@ |
| icon_animation_.reset(animation); |
| } |
| -void Tab::StopAudioPlayingAnimation() { |
| - if (!icon_animation_.get()) |
| - return; |
| - icon_animation_->Stop(); |
| - icon_animation_.reset(); |
| -} |
| - |
| bool Tab::IsPerformingCrashAnimation() const { |
| return icon_animation_.get() && data_.IsCrashed(); |
| } |