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

Side by Side Diff: cc/input/top_controls_manager.h

Issue 2106753004: Introduce bottom controls to CC and let it respond to scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust documentations Created 4 years, 5 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
« no previous file with comments | « no previous file | cc/input/top_controls_manager.cc » ('j') | cc/output/compositor_frame_metadata.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_INPUT_TOP_CONTROLS_MANAGER_H_ 5 #ifndef CC_INPUT_TOP_CONTROLS_MANAGER_H_
6 #define CC_INPUT_TOP_CONTROLS_MANAGER_H_ 6 #define CC_INPUT_TOP_CONTROLS_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 18 matching lines...) Expand all
29 SHOWING_CONTROLS, 29 SHOWING_CONTROLS,
30 HIDING_CONTROLS 30 HIDING_CONTROLS
31 }; 31 };
32 32
33 static std::unique_ptr<TopControlsManager> Create( 33 static std::unique_ptr<TopControlsManager> Create(
34 TopControlsManagerClient* client, 34 TopControlsManagerClient* client,
35 float top_controls_show_threshold, 35 float top_controls_show_threshold,
36 float top_controls_hide_threshold); 36 float top_controls_hide_threshold);
37 virtual ~TopControlsManager(); 37 virtual ~TopControlsManager();
38 38
39 // The offset from the window top to the top edge of the controls. Runs from 0
40 // (controls fully shown) to negative values (down is positive).
39 float ControlsTopOffset() const; 41 float ControlsTopOffset() const;
42 // The amount of offset of the web content area. Same as the current shown
43 // height of the top controls.
40 float ContentTopOffset() const; 44 float ContentTopOffset() const;
41 float TopControlsShownRatio() const; 45 float TopControlsShownRatio() const;
42 float TopControlsHeight() const; 46 float TopControlsHeight() const;
43 47
48 // The amount of offset to translate the bottom controls. 0 or positive value.
49 float ControlsBottomOffset() const;
50 // The amount of offset of the web content area, calculating from the bottom.
51 // Same as the current shown height of the bottom controls.
52 float ContentBottomOffset() const;
53 // Similar to TopControlsHeight(), this method should return a static value.
54 // The current animated height can be got from ContentBottomOffset().
55 float BottomControlsHeight() const;
56
44 bool has_animation() const { return animation_direction_ != NO_ANIMATION; } 57 bool has_animation() const { return animation_direction_ != NO_ANIMATION; }
45 AnimationDirection animation_direction() { return animation_direction_; } 58 AnimationDirection animation_direction() { return animation_direction_; }
46 59
47 void UpdateTopControlsState(TopControlsState constraints, 60 void UpdateTopControlsState(TopControlsState constraints,
48 TopControlsState current, 61 TopControlsState current,
49 bool animate); 62 bool animate);
50 63
51 void ScrollBegin(); 64 void ScrollBegin();
52 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& pending_delta); 65 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& pending_delta);
53 void ScrollEnd(); 66 void ScrollEnd();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 float top_controls_hide_threshold_; 112 float top_controls_hide_threshold_;
100 113
101 bool pinch_gesture_active_; 114 bool pinch_gesture_active_;
102 115
103 DISALLOW_COPY_AND_ASSIGN(TopControlsManager); 116 DISALLOW_COPY_AND_ASSIGN(TopControlsManager);
104 }; 117 };
105 118
106 } // namespace cc 119 } // namespace cc
107 120
108 #endif // CC_INPUT_TOP_CONTROLS_MANAGER_H_ 121 #endif // CC_INPUT_TOP_CONTROLS_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/input/top_controls_manager.cc » ('j') | cc/output/compositor_frame_metadata.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698