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

Side by Side Diff: client/touch/Scroller.dart

Issue 8666012: Partial fix to client breakage (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Implementation of a custom scrolling behavior. 6 * Implementation of a custom scrolling behavior.
7 * This behavior overrides native scrolling for an area. This area can be a 7 * This behavior overrides native scrolling for an area. This area can be a
8 * single defined part of a page, the entire page, or several different parts 8 * single defined part of a page, the entire page, or several different parts
9 * of a page. 9 * of a page.
10 * 10 *
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 Size _scrollSize; 128 Size _scrollSize;
129 Size _contentSize; 129 Size _contentSize;
130 Coordinate _minPoint; 130 Coordinate _minPoint;
131 bool _isStopping = false; 131 bool _isStopping = false;
132 Coordinate _contentStartOffset; 132 Coordinate _contentStartOffset;
133 bool _started = false; 133 bool _started = false;
134 bool _activeGesture = false; 134 bool _activeGesture = false;
135 ScrollWatcher _scrollWatcher; 135 ScrollWatcher _scrollWatcher;
136 136
137 Scroller(Element scrollableElem, [this.verticalEnabled = false, 137 Scroller(Element scrollableElem, [verticalEnabled = false,
138 this.horizontalEnabled = false, 138 horizontalEnabled = false,
139 this._momentumEnabled = true, 139 momentumEnabled = true,
140 this._lookupContentSizeDelegate = null, 140 lookupContentSizeDelegate = null,
141 num defaultDecelerationFactor = 1, 141 num defaultDecelerationFactor = 1,
142 int scrollTechnique = null, bool capture = false]) 142 int scrollTechnique = null, bool capture = false])
143 : _element = scrollableElem, 143 : this.verticalEnabled = verticalEnabled,
144 this.horizontalEnabled = horizontalEnabled,
145 this._momentumEnabled = momentumEnabled,
146 this._lookupContentSizeDelegate = lookupContentSizeDelegate,
147 _element = scrollableElem,
144 _frame = scrollableElem.parent, 148 _frame = scrollableElem.parent,
145 _scrollTechnique = scrollTechnique !== null 149 _scrollTechnique = scrollTechnique !== null
146 ? scrollTechnique : ScrollerScrollTechnique.TRANSFORM_3D, 150 ? scrollTechnique : ScrollerScrollTechnique.TRANSFORM_3D,
147 _minPoint = new Coordinate(0, 0), 151 _minPoint = new Coordinate(0, 0),
148 _maxPoint = new Coordinate(0, 0), 152 _maxPoint = new Coordinate(0, 0),
149 _maxOffset = new Coordinate(0, 0), 153 _maxOffset = new Coordinate(0, 0),
150 _minOffset = new Coordinate(0, 0), 154 _minOffset = new Coordinate(0, 0),
151 _contentOffset = new Coordinate(0, 0) { 155 _contentOffset = new Coordinate(0, 0) {
152 _touchHandler = new TouchHandler(this, scrollableElem.parent); 156 _touchHandler = new TouchHandler(this, scrollableElem.parent);
153 _momentum = new Momentum(this, defaultDecelerationFactor); 157 _momentum = new Momentum(this, defaultDecelerationFactor);
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 for (EventListener listener in _listeners) { 724 for (EventListener listener in _listeners) {
721 listener(evt); 725 listener(evt);
722 } 726 }
723 } 727 }
724 } 728 }
725 729
726 class ScrollerScrollTechnique { 730 class ScrollerScrollTechnique {
727 static final TRANSFORM_3D = 1; 731 static final TRANSFORM_3D = 1;
728 static final RELATIVE_POSITIONING = 2; 732 static final RELATIVE_POSITIONING = 2;
729 } 733 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698