OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_FULLSCREEN_FULLSCREEN_TOOLBAR_ANIMATION_CONTROLL
ER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_FULLSCREEN_FULLSCREEN_TOOLBAR_ANIMATION_CONTROLL
ER_H_ |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 #include "base/timer/timer.h" |
| 11 #include "ui/gfx/animation/animation_delegate.h" |
| 12 #include "ui/gfx/animation/slide_animation.h" |
| 13 |
| 14 @class FullscreenToolbarController; |
| 15 |
| 16 // This class provides a controller that manages the fullscreen toolbar's |
| 17 // animation. |
| 18 class FullscreenToolbarAnimationController : public gfx::AnimationDelegate { |
| 19 public: |
| 20 explicit FullscreenToolbarAnimationController( |
| 21 FullscreenToolbarController* owner); |
| 22 |
| 23 // Called by |owner_| when the fullscreen toolbar layout is updated. |
| 24 void ToolbarDidUpdate(); |
| 25 |
| 26 // Stops the animation and cancels |hide_toolbar_timer_|. |
| 27 void StopAnimationAndTimer(); |
| 28 |
| 29 // Animates the toolbar in and out to show changes with the tabstrip. |
| 30 void AnimateToolbarForTabstripChanges(); |
| 31 |
| 32 // Animates the toolbar in if it's not fully shown. |
| 33 void AnimateToolbarIn(); |
| 34 |
| 35 // Animates the toolbar out if it's not focused. |
| 36 void AnimateToolbarOutIfPossible(); |
| 37 |
| 38 // Returns the fraction of the toolbar exposed at the top according to the |
| 39 // animation's progress. |
| 40 CGFloat GetToolbarFractionFromProgress() const; |
| 41 |
| 42 // Returns true if |animation_| is running. |
| 43 bool IsAnimationRunning() const; |
| 44 |
| 45 // gfx::AnimationDelegate: |
| 46 void AnimationProgressed(const gfx::Animation* animation) override; |
| 47 void AnimationEnded(const gfx::Animation* animation) override; |
| 48 |
| 49 private: |
| 50 // Our owner. |
| 51 FullscreenToolbarController* owner_; // weak |
| 52 |
| 53 // The animation of the decoration. |
| 54 gfx::SlideAnimation animation_; |
| 55 |
| 56 // Timer that will start the scrollbar's hiding animation when it reaches 0. |
| 57 base::Timer hide_toolbar_timer_; |
| 58 |
| 59 // The value that the animation should start from. |
| 60 CGFloat animation_start_value_; |
| 61 |
| 62 // True when the toolbar is dropped to show tabstrip changes. |
| 63 BOOL should_hide_toolbar_after_delay_; |
| 64 }; |
| 65 |
| 66 #endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_FULLSCREEN_TOOLBAR_ANIMATION_CONTR
OLLER_H_ |
OLD | NEW |