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

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: Add missing CC_EXPORT...learn to run try jobs manually 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
« no previous file with comments | « cc/switches.cc ('k') | cc/top_controls_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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 CC_EXPORT TopControlsManager {
26 public:
27 static scoped_ptr<TopControlsManager> Create(TopControlsManagerClient* client,
28 float top_controls_height);
29 virtual ~TopControlsManager();
30
31 void set_content_layer_id(int id) { content_layer_id_ = id; }
32 float controls_top_offset() { return controls_top_offset_; }
33 float content_top_offset() { return content_top_offset_; }
34 float is_overlay_mode() { return is_overlay_mode_; }
35 KeyframedFloatAnimationCurve* animation() {
36 return top_controls_animation_.get();
37 }
38
39 void UpdateDrawPositions();
40
41 void ScrollBegin();
42 gfx::Vector2dF ScrollBy(const gfx::Vector2dF pending_delta);
43 void ScrollEnd();
44
45 void Animate(base::TimeTicks monotonic_time);
46
47 protected:
48 TopControlsManager(TopControlsManagerClient* client,
49 float top_controls_height);
50
51 private:
52 gfx::Vector2dF ScrollInternal(const gfx::Vector2dF pending_delta);
53 void ResetAnimations();
54 LayerImpl* RootScrollLayer();
55 float RootScrollLayerTotalScrollY();
56 void SetupAnimation(bool show_controls);
57 void StartAnimationIfNecessary();
58
59 TopControlsManagerClient* client_; // The client manages the lifecycle of
60 // this.
61
62 scoped_ptr<KeyframedFloatAnimationCurve> top_controls_animation_;
63 int content_layer_id_;
64 bool is_showing_animation_;
65 bool is_overlay_mode_;
66 float controls_top_offset_;
67 float content_top_offset_;
68 float top_controls_height_;
69 bool scroll_readjustment_enabled_;
70 float previous_root_scroll_offset_;
71
72 DISALLOW_COPY_AND_ASSIGN(TopControlsManager);
73 };
74
75 } // namespace cc
76
77 #endif // CC_TOP_CONTROLS_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/switches.cc ('k') | cc/top_controls_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698