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

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: Removed unnecessary #include statements Created 4 years, 1 month 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 namespace {
erikchen 2016/10/21 17:22:03 don't use anonymous namespaces in header files. Us
spqchan 2016/10/21 18:26:55 Removed
15 class FullscreenToolbarLayoutTest;
16 }
17
18 @class FullscreenToolbarController;
19
20 class FullscreenToolbarAnimationController : public gfx::AnimationDelegate {
21 public:
22 FullscreenToolbarAnimationController(FullscreenToolbarController* owner);
23
24 // Called by |owner_| to update the current toolbar fraction.
25 void UpdateToolbarFraction(CGFloat fraction);
26
27 // Stops the animation and cancels |hide_toolbar_timer_|.
28 void StopAnimationAndTimer();
29
30 // Animates the toolbar in and out to show changes with the tabstrip.
31 void AnimateToolbarForTabstripChanges();
32
33 // Animates the toolbar in if it's not fully shown.
34 void AnimateToolbarIn();
35
36 // Animates the toolbar out if it's not focused.
37 void AnimateToolbarOutIfPossible();
38
39 // Returns the toolbar fraction calculated from the animation progress.
40 CGFloat GetToolbarFraction() 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 friend class ::FullscreenToolbarLayoutTest;
51
52 // Our owner.
53 FullscreenToolbarController* owner_; // weak
54
55 // The animation of the decoration.
56 gfx::SlideAnimation animation_;
57
58 // Timer that will start the scrollbar's hiding animation when it reaches 0.
59 base::Timer hide_toolbar_timer_;
60
61 // The current fraction of the toolbar being displayed. Used as the starting
62 // point of the animation.
63 CGFloat toolbar_fraction_;
64
65 // True when the toolbar is dropped to show tabstrip changes.
66 BOOL should_hide_toolbar_after_delay_;
67
68 // Used to disable find bar animations when testing.
69 BOOL disable_animations_during_testing_;
erikchen 2016/10/21 17:22:03 I notice this isn't used yet. Given that this CL i
spqchan 2016/10/21 18:26:55 Removed this since it looks like the tests need to
erikchen 2016/10/21 19:36:59 yeah, but that wording is a little bit awkward. Ma
spqchan 2016/10/21 20:34:18 Ah, gotcha. Parameters won't be necessary for this
70 };
71
72 #endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_FULLSCREEN_TOOLBAR_ANIMATION_CONTR OLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698