Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.h

Issue 2430403003: [Mac] Refactor the fullscreen toolbar animation (Closed)
Patch Set: Fix for erikchen 3 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 {
Robert Sesek 2016/10/24 18:17:32 Class-level comment?
spqchan 2016/10/24 18:55:19 Done.
17 public:
18 FullscreenToolbarAnimationController(FullscreenToolbarController* owner);
Robert Sesek 2016/10/24 18:17:32 explicit
spqchan 2016/10/24 18:55:19 Done.
19
20 // Called by |owner_| when the fullscreen toolbar layout is updated.
21 void ToolbarDidUpdate();
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.
Robert Sesek 2016/10/24 18:17:32 Explain what the toolbar fraction is here.
spqchan 2016/10/24 18:55:19 Done.
36 CGFloat GetToolbarFractionFromProgress() const;
37
38 // Returns true if |animation_| is running.
39 BOOL IsAnimationRunning() const;
Robert Sesek 2016/10/24 18:17:32 Use C++ bool here since the rest of the interface
spqchan 2016/10/24 18:55:19 Done.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698