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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.h

Issue 2383113003: Refactor ScrollableArea::setScrollPosition. (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2011 Apple 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 virtual void scrollbarStyleChanged() {} 224 virtual void scrollbarStyleChanged() {}
225 virtual void scrollbarVisibilityChanged() {} 225 virtual void scrollbarVisibilityChanged() {}
226 virtual bool scrollbarsCanBeActive() const = 0; 226 virtual bool scrollbarsCanBeActive() const = 0;
227 227
228 // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view. 228 // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view.
229 virtual IntRect scrollableAreaBoundingBox() const = 0; 229 virtual IntRect scrollableAreaBoundingBox() const = 0;
230 230
231 virtual bool scrollAnimatorEnabled() const { return false; } 231 virtual bool scrollAnimatorEnabled() const { return false; }
232 232
233 // NOTE: Only called from Internals for testing. 233 // NOTE: Only called from Internals for testing.
234 void setScrollOffsetFromInternals(const IntPoint&); 234 void updateScrollPositionFromInternals(const IntPoint&);
235 235
236 IntPoint clampScrollPosition(const IntPoint&) const; 236 IntPoint clampScrollPosition(const IntPoint&) const;
237 DoublePoint clampScrollPosition(const DoublePoint&) const; 237 DoublePoint clampScrollPosition(const DoublePoint&) const;
238 238
239 // Let subclasses provide a way of asking for and servicing scroll 239 // Let subclasses provide a way of asking for and servicing scroll
240 // animations. 240 // animations.
241 virtual bool scheduleAnimation(); 241 virtual bool scheduleAnimation();
242 virtual void serviceScrollAnimations(double monotonicTime); 242 virtual void serviceScrollAnimations(double monotonicTime);
243 virtual void updateCompositorScrollAnimations(); 243 virtual void updateCompositorScrollAnimations();
244 virtual void registerForAnimation() {} 244 virtual void registerForAnimation() {}
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 m_horizontalScrollbarNeedsPaintInvalidation = false; 366 m_horizontalScrollbarNeedsPaintInvalidation = false;
367 m_verticalScrollbarNeedsPaintInvalidation = false; 367 m_verticalScrollbarNeedsPaintInvalidation = false;
368 m_scrollCornerNeedsPaintInvalidation = false; 368 m_scrollCornerNeedsPaintInvalidation = false;
369 } 369 }
370 370
371 private: 371 private:
372 void programmaticScrollHelper(const DoublePoint&, ScrollBehavior); 372 void programmaticScrollHelper(const DoublePoint&, ScrollBehavior);
373 void userScrollHelper(const DoublePoint&, ScrollBehavior); 373 void userScrollHelper(const DoublePoint&, ScrollBehavior);
374 374
375 // This function should be overriden by subclasses to perform the actual scrol l of the content. 375 // This function should be overriden by subclasses to perform the actual scrol l of the content.
376 virtual void setScrollOffset(const DoublePoint& offset, ScrollType) = 0; 376 virtual void updateScrollPosition(const DoublePoint&, ScrollType) = 0;
377 377
378 virtual int lineStep(ScrollbarOrientation) const; 378 virtual int lineStep(ScrollbarOrientation) const;
379 virtual int pageStep(ScrollbarOrientation) const; 379 virtual int pageStep(ScrollbarOrientation) const;
380 virtual int documentStep(ScrollbarOrientation) const; 380 virtual int documentStep(ScrollbarOrientation) const;
381 virtual float pixelStep(ScrollbarOrientation) const; 381 virtual float pixelStep(ScrollbarOrientation) const;
382 382
383 mutable Member<ScrollAnimatorBase> m_scrollAnimator; 383 mutable Member<ScrollAnimatorBase> m_scrollAnimator;
384 mutable Member<ProgrammaticScrollAnimator> m_programmaticScrollAnimator; 384 mutable Member<ProgrammaticScrollAnimator> m_programmaticScrollAnimator;
385 385
386 unsigned m_scrollbarOverlayStyle : 2; // ScrollbarOverlayStyle 386 unsigned m_scrollbarOverlayStyle : 2; // ScrollbarOverlayStyle
(...skipping 12 matching lines...) Expand all
399 // vertical-lr / ltr NO NO 399 // vertical-lr / ltr NO NO
400 // vertical-lr / rtl NO YES 400 // vertical-lr / rtl NO YES
401 // vertical-rl / ltr YES NO 401 // vertical-rl / ltr YES NO
402 // vertical-rl / rtl YES YES 402 // vertical-rl / rtl YES YES
403 IntPoint m_scrollOrigin; 403 IntPoint m_scrollOrigin;
404 }; 404 };
405 405
406 } // namespace blink 406 } // namespace blink
407 407
408 #endif // ScrollableArea_h 408 #endif // ScrollableArea_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698