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

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

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: Rebase Created 3 years, 3 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 | « cc/input/input_handler.h ('k') | cc/input/scroll_state.h » ('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 (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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_SCROLL_BOUNDARY_BEHAVIOR_H_ 5 #ifndef CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_
6 #define CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ 6 #define CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_
7 7
8 #include "cc/cc_export.h" 8 #include "cc/cc_export.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 struct CC_EXPORT ScrollBoundaryBehavior { 12 struct CC_EXPORT ScrollBoundaryBehavior {
13 enum ScrollBoundaryBehaviorType { 13 enum ScrollBoundaryBehaviorType {
14 // Same as contain but also hint that no overscroll affordance should be 14 // Same as contain but also hint that no overscroll affordance should be
15 // triggered. 15 // triggered.
16 kScrollBoundaryBehaviorTypeNone, 16 kScrollBoundaryBehaviorTypeNone,
17 // Allows the default behavior for the user agent. 17 // Allows the default behavior for the user agent.
18 kScrollBoundaryBehaviorTypeAuto, 18 kScrollBoundaryBehaviorTypeAuto,
19 // Hint to disable scroll chaining. The user agent may show an appropriate 19 // Hint to disable scroll chaining. The user agent may show an appropriate
20 // overscroll affordance. 20 // overscroll affordance.
21 kScrollBoundaryBehaviorTypeContain 21 kScrollBoundaryBehaviorTypeContain,
22 kScrollBoundaryBehaviorTypeMax = kScrollBoundaryBehaviorTypeContain
22 }; 23 };
23 24
24 ScrollBoundaryBehavior() 25 ScrollBoundaryBehavior()
25 : x(kScrollBoundaryBehaviorTypeAuto), 26 : x(kScrollBoundaryBehaviorTypeAuto),
26 y(kScrollBoundaryBehaviorTypeAuto) {} 27 y(kScrollBoundaryBehaviorTypeAuto) {}
27 explicit ScrollBoundaryBehavior(ScrollBoundaryBehaviorType type) 28 explicit ScrollBoundaryBehavior(ScrollBoundaryBehaviorType type)
28 : x(type), y(type) {} 29 : x(type), y(type) {}
29 ScrollBoundaryBehavior(ScrollBoundaryBehaviorType x_type, 30 ScrollBoundaryBehavior(ScrollBoundaryBehaviorType x_type,
30 ScrollBoundaryBehaviorType y_type) 31 ScrollBoundaryBehaviorType y_type)
31 : x(x_type), y(y_type) {} 32 : x(x_type), y(y_type) {}
32 33
33 ScrollBoundaryBehaviorType x; 34 ScrollBoundaryBehaviorType x;
34 ScrollBoundaryBehaviorType y; 35 ScrollBoundaryBehaviorType y;
35 36
36 bool operator==(const ScrollBoundaryBehavior& a) const { 37 bool operator==(const ScrollBoundaryBehavior& a) const {
37 return (a.x == x) && (a.y == y); 38 return (a.x == x) && (a.y == y);
38 } 39 }
39 bool operator!=(const ScrollBoundaryBehavior& a) const { 40 bool operator!=(const ScrollBoundaryBehavior& a) const {
40 return !(*this == a); 41 return !(*this == a);
41 } 42 }
42 }; 43 };
43 44
44 } // namespace cc 45 } // namespace cc
45 46
46 #endif // CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ 47 #endif // CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_
OLDNEW
« no previous file with comments | « cc/input/input_handler.h ('k') | cc/input/scroll_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698