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

Side by Side Diff: Source/platform/scroll/ScrollTypes.h

Issue 1150003003: Cleanup ScrollableArea scrolling API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/platform/scroll/ScrollAnimatorNone.cpp ('k') | Source/platform/scroll/ScrollableArea.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 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef ScrollTypes_h 26 #ifndef ScrollTypes_h
27 #define ScrollTypes_h 27 #define ScrollTypes_h
28 28
29 #include "wtf/Assertions.h" 29 #include "wtf/Assertions.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 enum ScrollType {
34 UserScroll,
35 ProgrammaticScroll,
36 CompositorScroll
37 };
38
33 enum ScrollDirection { 39 enum ScrollDirection {
34 ScrollUpIgnoringWritingMode, 40 ScrollUpIgnoringWritingMode,
35 ScrollDownIgnoringWritingMode, 41 ScrollDownIgnoringWritingMode,
36 ScrollLeftIgnoringWritingMode, 42 ScrollLeftIgnoringWritingMode,
37 ScrollRightIgnoringWritingMode, 43 ScrollRightIgnoringWritingMode,
38 44
39 ScrollBlockDirectionBackward, 45 ScrollBlockDirectionBackward,
40 ScrollBlockDirectionForward, 46 ScrollBlockDirectionForward,
41 ScrollInlineDirectionBackward, 47 ScrollInlineDirectionBackward,
42 ScrollInlineDirectionForward 48 ScrollInlineDirectionForward
43 }; 49 };
44 50
45 enum ScrollDirectionPhysical { 51 enum ScrollDirectionPhysical {
46 ScrollUp, 52 ScrollUp,
47 ScrollDown, 53 ScrollDown,
48 ScrollLeft, 54 ScrollLeft,
49 ScrollRight 55 ScrollRight
50 }; 56 };
51 57
52 enum ScrollType {
53 UserScroll,
54 ProgrammaticScroll,
55 CompositorScroll
56 };
57
58 // Convert logical scroll direction to physical. Physical scroll directions are unaffected. 58 // Convert logical scroll direction to physical. Physical scroll directions are unaffected.
59 inline ScrollDirectionPhysical toPhysicalDirection(ScrollDirection direction, bo ol isVertical, bool isFlipped) 59 inline ScrollDirectionPhysical toPhysicalDirection(ScrollDirection direction, bo ol isVertical, bool isFlipped)
60 { 60 {
61 switch (direction) { 61 switch (direction) {
62 case ScrollBlockDirectionBackward: { 62 case ScrollBlockDirectionBackward: {
63 if (isVertical) { 63 if (isVertical) {
64 if (!isFlipped) 64 if (!isFlipped)
65 return ScrollUp; 65 return ScrollUp;
66 return ScrollDown; 66 return ScrollDown;
67 } 67 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 bool didScrollY; 216 bool didScrollY;
217 float unusedScrollDeltaX; 217 float unusedScrollDeltaX;
218 float unusedScrollDeltaY; 218 float unusedScrollDeltaY;
219 }; 219 };
220 220
221 typedef unsigned ScrollbarControlPartMask; 221 typedef unsigned ScrollbarControlPartMask;
222 222
223 } 223 }
224 224
225 #endif 225 #endif
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollAnimatorNone.cpp ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698