| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_control
ler.h" | 5 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_control
ler.h" |
| 6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h" | 7 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 animation_.Show(); | 69 animation_.Show(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void FullscreenToolbarAnimationController::AnimateToolbarOutIfPossible() { | 72 void FullscreenToolbarAnimationController::AnimateToolbarOutIfPossible() { |
| 73 if (![owner_ isInFullscreen] || [owner_ mustShowFullscreenToolbar]) | 73 if (![owner_ isInFullscreen] || [owner_ mustShowFullscreenToolbar]) |
| 74 return; | 74 return; |
| 75 | 75 |
| 76 if (animation_.IsClosing()) | 76 if (animation_.IsClosing()) |
| 77 return; | 77 return; |
| 78 | 78 |
| 79 animation_.Reset(animation_start_value_); | 79 animation_.Stop(); |
| 80 animation_.Hide(); | 80 animation_.Hide(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 CGFloat FullscreenToolbarAnimationController::GetToolbarFractionFromProgress() | 83 CGFloat FullscreenToolbarAnimationController::GetToolbarFractionFromProgress() |
| 84 const { | 84 const { |
| 85 return animation_.GetCurrentValue(); | 85 return animation_.GetCurrentValue(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool FullscreenToolbarAnimationController::IsAnimationRunning() const { | 88 bool FullscreenToolbarAnimationController::IsAnimationRunning() const { |
| 89 return animation_.is_animating(); | 89 return animation_.is_animating(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 102 [owner_ updateToolbarLayout]; | 102 [owner_ updateToolbarLayout]; |
| 103 } | 103 } |
| 104 | 104 |
| 105 void FullscreenToolbarAnimationController::AnimationEnded( | 105 void FullscreenToolbarAnimationController::AnimationEnded( |
| 106 const gfx::Animation* animation) { | 106 const gfx::Animation* animation) { |
| 107 if (animation_.IsShowing() && should_hide_toolbar_after_delay_) { | 107 if (animation_.IsShowing() && should_hide_toolbar_after_delay_) { |
| 108 hide_toolbar_timer_.Reset(); | 108 hide_toolbar_timer_.Reset(); |
| 109 should_hide_toolbar_after_delay_ = false; | 109 should_hide_toolbar_after_delay_ = false; |
| 110 } | 110 } |
| 111 } | 111 } |
| OLD | NEW |