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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 animation_.Show(); | 71 animation_.Show(); |
72 } | 72 } |
73 | 73 |
74 void FullscreenToolbarAnimationController::AnimateToolbarOutIfPossible() { | 74 void FullscreenToolbarAnimationController::AnimateToolbarOutIfPossible() { |
75 if (![owner_ isInFullscreen] || [owner_ mustShowFullscreenToolbar]) | 75 if (![owner_ isInFullscreen] || [owner_ mustShowFullscreenToolbar]) |
76 return; | 76 return; |
77 | 77 |
78 if (animation_.IsClosing()) | 78 if (animation_.IsClosing()) |
79 return; | 79 return; |
80 | 80 |
81 animation_.Reset(animation_start_value_); | 81 animation_.Stop(); |
82 animation_.Hide(); | 82 animation_.Hide(); |
83 } | 83 } |
84 | 84 |
85 CGFloat FullscreenToolbarAnimationController::GetToolbarFractionFromProgress() | 85 CGFloat FullscreenToolbarAnimationController::GetToolbarFractionFromProgress() |
86 const { | 86 const { |
87 return animation_.GetCurrentValue(); | 87 return animation_.GetCurrentValue(); |
88 } | 88 } |
89 | 89 |
90 bool FullscreenToolbarAnimationController::IsAnimationRunning() const { | 90 bool FullscreenToolbarAnimationController::IsAnimationRunning() const { |
91 return animation_.is_animating(); | 91 return animation_.is_animating(); |
(...skipping 12 matching lines...) Expand all Loading... |
104 [owner_ updateToolbarLayout]; | 104 [owner_ updateToolbarLayout]; |
105 } | 105 } |
106 | 106 |
107 void FullscreenToolbarAnimationController::AnimationEnded( | 107 void FullscreenToolbarAnimationController::AnimationEnded( |
108 const gfx::Animation* animation) { | 108 const gfx::Animation* animation) { |
109 if (animation_.IsShowing() && should_hide_toolbar_after_delay_) { | 109 if (animation_.IsShowing() && should_hide_toolbar_after_delay_) { |
110 hide_toolbar_timer_.Reset(); | 110 hide_toolbar_timer_.Reset(); |
111 should_hide_toolbar_after_delay_ = false; | 111 should_hide_toolbar_after_delay_ = false; |
112 } | 112 } |
113 } | 113 } |
OLD | NEW |