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

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: findbug Created 4 years, 4 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') | no next file with comments »
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 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
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_
OLDNEW
« no previous file with comments | « no previous file | cc/input/top_controls_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698