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

Side by Side Diff: cc/top_controls_manager.h

Issue 11552009: Add support for calculating the position of the top controls in the cc layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove auto-hide per UX decision. Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2012 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 CC_TOP_CONTROLS_MANAGER_H_
6 #define CC_TOP_CONTROLS_MANAGER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10 #include "cc/layer_impl.h"
11 #include "ui/gfx/size.h"
12 #include "ui/gfx/vector2d_f.h"
13
14 namespace base {
15 class TimeTicks;
16 }
17
18 namespace cc {
19
20 class KeyframedFloatAnimationCurve;
21 class LayerTreeImpl;
22 class TopControlsManagerClient;
23
24 // Manages the position of the top controls.
25 class TopControlsManager {
26 public:
27 static scoped_ptr<TopControlsManager> Create(TopControlsManagerClient* client,
28 float top_controls_height);
29 virtual ~TopControlsManager();
30
31 float controls_top_offset() { return controls_top_offset_; }
32 float content_top_offset() { return content_top_offset_; }
33 float is_overlay_mode() { return is_overlay_mode_; }
34 KeyframedFloatAnimationCurve* animation() {
35 return top_controls_animation_.get();
36 }
37
38 void UpdateDrawPositions();
39
40 void ScrollBegin();
41 gfx::Vector2dF ScrollBy(const gfx::Vector2dF pending_delta);
42 void ScrollEnd();
43
44 void Animate(base::TimeTicks monotonic_time);
45
46 protected:
47 TopControlsManager(TopControlsManagerClient* client,
48 float top_controls_height);
49
50 private:
51 gfx::Vector2dF ScrollInternal(const gfx::Vector2dF pending_delta);
52 void ResetAnimations();
53 LayerImpl* RootScrollLayer();
54 float RootScrollLayerTotalScrollY();
55 void SetupAnimation(bool show_controls);
56 void StartAnimationIfNecessary();
57
58 TopControlsManagerClient* client_; // The client manages the lifecycle of
59 // this.
60
61 scoped_ptr<KeyframedFloatAnimationCurve> top_controls_animation_;
62 bool is_showing_animation_;
63 bool is_overlay_mode_;
64 float controls_top_offset_;
65 float content_top_offset_;
66 float top_controls_height_;
67 bool scroll_readjustment_enabled_;
68 float previous_root_scroll_offset_;
69
70 DISALLOW_COPY_AND_ASSIGN(TopControlsManager);
71 };
72
73 } // namespace cc
74
75 #endif // CC_TOP_CONTROLS_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/switches.cc ('k') | cc/top_controls_manager.cc » ('j') | cc/top_controls_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698