OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_CONTROLS_OFFSET_MANAGER_H_ | 5 #ifndef CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_ |
6 #define CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_ | 6 #define CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 BrowserControlsOffsetManager(BrowserControlsOffsetManagerClient* client, | 73 BrowserControlsOffsetManager(BrowserControlsOffsetManagerClient* client, |
74 float controls_show_threshold, | 74 float controls_show_threshold, |
75 float controls_hide_threshold); | 75 float controls_hide_threshold); |
76 | 76 |
77 private: | 77 private: |
78 void ResetAnimations(); | 78 void ResetAnimations(); |
79 void SetupAnimation(AnimationDirection direction); | 79 void SetupAnimation(AnimationDirection direction); |
80 void StartAnimationIfNecessary(); | 80 void StartAnimationIfNecessary(); |
81 bool IsAnimationComplete(float new_ratio); | 81 bool IsAnimationComplete(float new_ratio); |
82 void ResetBaseline(); | 82 void ResetBaseline(); |
83 // Offset computation regardless of top or bottom control state. | |
84 float ContentOffsetInternal() const; | |
85 | 83 |
86 // The client manages the lifecycle of this. | 84 // The client manages the lifecycle of this. |
87 BrowserControlsOffsetManagerClient* client_; | 85 BrowserControlsOffsetManagerClient* client_; |
88 | 86 |
89 base::TimeTicks animation_start_time_; | 87 base::TimeTicks animation_start_time_; |
90 float animation_start_value_; | 88 float animation_start_value_; |
91 base::TimeTicks animation_stop_time_; | 89 base::TimeTicks animation_stop_time_; |
92 float animation_stop_value_; | 90 float animation_stop_value_; |
93 AnimationDirection animation_direction_; | 91 AnimationDirection animation_direction_; |
94 | 92 |
(...skipping 14 matching lines...) Expand all Loading... |
109 float controls_hide_threshold_; | 107 float controls_hide_threshold_; |
110 | 108 |
111 bool pinch_gesture_active_; | 109 bool pinch_gesture_active_; |
112 | 110 |
113 DISALLOW_COPY_AND_ASSIGN(BrowserControlsOffsetManager); | 111 DISALLOW_COPY_AND_ASSIGN(BrowserControlsOffsetManager); |
114 }; | 112 }; |
115 | 113 |
116 } // namespace cc | 114 } // namespace cc |
117 | 115 |
118 #endif // CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_ | 116 #endif // CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_ |
OLD | NEW |