| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void FullscreenToolbarAnimationController::SetAnimationDuration( |
| 93 CGFloat duration) { |
| 94 animation_.SetSlideDuration(duration); |
| 95 } |
| 96 |
| 92 ////////////////////////////////////////////////////////////////// | 97 ////////////////////////////////////////////////////////////////// |
| 93 // FullscreenToolbarAnimationController::AnimationDelegate: | 98 // FullscreenToolbarAnimationController::AnimationDelegate: |
| 94 | 99 |
| 95 void FullscreenToolbarAnimationController::AnimationProgressed( | 100 void FullscreenToolbarAnimationController::AnimationProgressed( |
| 96 const gfx::Animation* animation) { | 101 const gfx::Animation* animation) { |
| 97 [owner_ updateToolbarLayout]; | 102 [owner_ updateToolbarLayout]; |
| 98 } | 103 } |
| 99 | 104 |
| 100 void FullscreenToolbarAnimationController::AnimationEnded( | 105 void FullscreenToolbarAnimationController::AnimationEnded( |
| 101 const gfx::Animation* animation) { | 106 const gfx::Animation* animation) { |
| 102 if (animation_.IsShowing() && should_hide_toolbar_after_delay_) { | 107 if (animation_.IsShowing() && should_hide_toolbar_after_delay_) { |
| 103 hide_toolbar_timer_.Reset(); | 108 hide_toolbar_timer_.Reset(); |
| 104 should_hide_toolbar_after_delay_ = false; | 109 should_hide_toolbar_after_delay_ = false; |
| 105 } | 110 } |
| 106 } | 111 } |
| OLD | NEW |