| OLD | NEW |
| 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 Loading... |
| 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 of the web content area, calculating from the bottom. |
| 49 // Same as the current shown height of the bottom controls. |
| 50 float ContentBottomOffset() const; |
| 51 // Similar to TopControlsHeight(), this method should return a static value. |
| 52 // The current animated height should be acquired from ContentBottomOffset(). |
| 53 float BottomControlsHeight() const; |
| 54 float BottomControlsShownRatio() const; |
| 55 |
| 44 bool has_animation() const { return animation_direction_ != NO_ANIMATION; } | 56 bool has_animation() const { return animation_direction_ != NO_ANIMATION; } |
| 45 AnimationDirection animation_direction() { return animation_direction_; } | 57 AnimationDirection animation_direction() { return animation_direction_; } |
| 46 | 58 |
| 47 void UpdateTopControlsState(TopControlsState constraints, | 59 void UpdateTopControlsState(TopControlsState constraints, |
| 48 TopControlsState current, | 60 TopControlsState current, |
| 49 bool animate); | 61 bool animate); |
| 50 | 62 |
| 51 void ScrollBegin(); | 63 void ScrollBegin(); |
| 52 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& pending_delta); | 64 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& pending_delta); |
| 53 void ScrollEnd(); | 65 void ScrollEnd(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 float top_controls_hide_threshold_; | 111 float top_controls_hide_threshold_; |
| 100 | 112 |
| 101 bool pinch_gesture_active_; | 113 bool pinch_gesture_active_; |
| 102 | 114 |
| 103 DISALLOW_COPY_AND_ASSIGN(TopControlsManager); | 115 DISALLOW_COPY_AND_ASSIGN(TopControlsManager); |
| 104 }; | 116 }; |
| 105 | 117 |
| 106 } // namespace cc | 118 } // namespace cc |
| 107 | 119 |
| 108 #endif // CC_INPUT_TOP_CONTROLS_MANAGER_H_ | 120 #endif // CC_INPUT_TOP_CONTROLS_MANAGER_H_ |
| OLD | NEW |