Chromium Code Reviews| 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 class FullscreenToolbarAnimationController : public gfx::AnimationDelegate { | |
| 17 public: | |
| 18 FullscreenToolbarAnimationController(FullscreenToolbarController* owner); | |
| 19 | |
| 20 // Called by |owner_| to when the fullscreen toolbar layout is updated. | |
|
erikchen
2016/10/21 19:36:59
s/to//
Also I'd recommend the name ToolbarDidUpda
spqchan
2016/10/21 20:34:18
Done.
| |
| 21 void UpdateToolbar(); | |
| 22 | |
| 23 // Stops the animation and cancels |hide_toolbar_timer_|. | |
| 24 void StopAnimationAndTimer(); | |
| 25 | |
| 26 // Animates the toolbar in and out to show changes with the tabstrip. | |
| 27 void AnimateToolbarForTabstripChanges(); | |
| 28 | |
| 29 // Animates the toolbar in if it's not fully shown. | |
| 30 void AnimateToolbarIn(); | |
| 31 | |
| 32 // Animates the toolbar out if it's not focused. | |
| 33 void AnimateToolbarOutIfPossible(); | |
| 34 | |
| 35 // Returns the toolbar fraction calculated from the animation progress. | |
| 36 CGFloat GetToolbarFractionFromProgress() const; | |
| 37 | |
| 38 // Returns true if |animation_| is running. | |
| 39 BOOL IsAnimationRunning() const; | |
| 40 | |
| 41 // gfx::AnimationDelegate: | |
| 42 void AnimationProgressed(const gfx::Animation* animation) override; | |
| 43 void AnimationEnded(const gfx::Animation* animation) override; | |
| 44 | |
| 45 private: | |
| 46 // Our owner. | |
| 47 FullscreenToolbarController* owner_; // weak | |
| 48 | |
| 49 // The animation of the decoration. | |
| 50 gfx::SlideAnimation animation_; | |
| 51 | |
| 52 // Timer that will start the scrollbar's hiding animation when it reaches 0. | |
| 53 base::Timer hide_toolbar_timer_; | |
| 54 | |
| 55 // The value that the animation should start from. | |
| 56 CGFloat animation_start_value_; | |
| 57 | |
| 58 // True when the toolbar is dropped to show tabstrip changes. | |
| 59 BOOL should_hide_toolbar_after_delay_; | |
| 60 }; | |
| 61 | |
| 62 #endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_FULLSCREEN_TOOLBAR_ANIMATION_CONTR OLLER_H_ | |
| OLD | NEW |