Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 359 // Need to promptly let go of owned animator objects. | 359 // Need to promptly let go of owned animator objects. |
| 360 EAGERLY_FINALIZE(); | 360 EAGERLY_FINALIZE(); |
| 361 DECLARE_VIRTUAL_TRACE(); | 361 DECLARE_VIRTUAL_TRACE(); |
| 362 | 362 |
| 363 virtual void clearScrollableArea(); | 363 virtual void clearScrollableArea(); |
| 364 | 364 |
| 365 virtual ScrollAnchor* scrollAnchor() { return nullptr; } | 365 virtual ScrollAnchor* scrollAnchor() { return nullptr; } |
| 366 | 366 |
| 367 virtual void didScrollWithScrollbar(ScrollbarPart, ScrollbarOrientation) {} | 367 virtual void didScrollWithScrollbar(ScrollbarPart, ScrollbarOrientation) {} |
| 368 | 368 |
| 369 // Returns the task runner to be used for scrollable area timers. | |
| 370 // Ideally a frame-specific throttled one can be used. | |
| 371 virtual RefPtr<WebTaskRunner> getTimerTaskRunner() const; | |
| 372 | |
| 369 protected: | 373 protected: |
| 370 ScrollableArea(); | 374 ScrollableArea(); |
| 371 | 375 |
| 372 ScrollbarOrientation scrollbarOrientationFromDirection( | 376 ScrollbarOrientation scrollbarOrientationFromDirection( |
| 373 ScrollDirectionPhysical) const; | 377 ScrollDirectionPhysical) const; |
| 374 float scrollStep(ScrollGranularity, ScrollbarOrientation) const; | 378 float scrollStep(ScrollGranularity, ScrollbarOrientation) const; |
| 375 | 379 |
| 376 void setScrollOrigin(const IntPoint&); | 380 void setScrollOrigin(const IntPoint&); |
| 377 void resetScrollOriginChanged() { m_scrollOriginChanged = false; } | 381 void resetScrollOriginChanged() { m_scrollOriginChanged = false; } |
| 378 | 382 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 virtual void updateScrollOffset(const ScrollOffset&, ScrollType) = 0; | 417 virtual void updateScrollOffset(const ScrollOffset&, ScrollType) = 0; |
| 414 | 418 |
| 415 virtual int lineStep(ScrollbarOrientation) const; | 419 virtual int lineStep(ScrollbarOrientation) const; |
| 416 virtual int pageStep(ScrollbarOrientation) const; | 420 virtual int pageStep(ScrollbarOrientation) const; |
| 417 virtual int documentStep(ScrollbarOrientation) const; | 421 virtual int documentStep(ScrollbarOrientation) const; |
| 418 virtual float pixelStep(ScrollbarOrientation) const; | 422 virtual float pixelStep(ScrollbarOrientation) const; |
| 419 | 423 |
| 420 mutable Member<ScrollAnimatorBase> m_scrollAnimator; | 424 mutable Member<ScrollAnimatorBase> m_scrollAnimator; |
| 421 mutable Member<ProgrammaticScrollAnimator> m_programmaticScrollAnimator; | 425 mutable Member<ProgrammaticScrollAnimator> m_programmaticScrollAnimator; |
| 422 | 426 |
| 423 std::unique_ptr<Timer<ScrollableArea>> m_fadeOverlayScrollbarsTimer; | 427 std::unique_ptr<TimerBase> m_fadeOverlayScrollbarsTimer; |
|
haraken
2017/01/20 05:45:51
Can we use TimerTaskRunner?
Can we make this Task
jbroman
2017/01/20 15:55:17
Changed to TaskRunnerTimer<ScrollableArea>.
| |
| 424 | 428 |
| 425 unsigned m_scrollbarOverlayColorTheme : 2; | 429 unsigned m_scrollbarOverlayColorTheme : 2; |
| 426 | 430 |
| 427 unsigned m_scrollOriginChanged : 1; | 431 unsigned m_scrollOriginChanged : 1; |
| 428 | 432 |
| 429 unsigned m_horizontalScrollbarNeedsPaintInvalidation : 1; | 433 unsigned m_horizontalScrollbarNeedsPaintInvalidation : 1; |
| 430 unsigned m_verticalScrollbarNeedsPaintInvalidation : 1; | 434 unsigned m_verticalScrollbarNeedsPaintInvalidation : 1; |
| 431 unsigned m_scrollCornerNeedsPaintInvalidation : 1; | 435 unsigned m_scrollCornerNeedsPaintInvalidation : 1; |
| 432 unsigned m_scrollbarsHidden : 1; | 436 unsigned m_scrollbarsHidden : 1; |
| 433 unsigned m_scrollbarCaptured : 1; | 437 unsigned m_scrollbarCaptured : 1; |
| 434 unsigned m_mouseOverScrollbar : 1; | 438 unsigned m_mouseOverScrollbar : 1; |
| 435 | 439 |
| 436 // There are 6 possible combinations of writing mode and direction. Scroll | 440 // There are 6 possible combinations of writing mode and direction. Scroll |
| 437 // origin will be non-zero in the x or y axis if there is any reversed | 441 // origin will be non-zero in the x or y axis if there is any reversed |
| 438 // direction or writing-mode. The combinations are: | 442 // direction or writing-mode. The combinations are: |
| 439 // writing-mode / direction scrollOrigin.x() set scrollOrigin.y() set | 443 // writing-mode / direction scrollOrigin.x() set scrollOrigin.y() set |
| 440 // horizontal-tb / ltr NO NO | 444 // horizontal-tb / ltr NO NO |
| 441 // horizontal-tb / rtl YES NO | 445 // horizontal-tb / rtl YES NO |
| 442 // vertical-lr / ltr NO NO | 446 // vertical-lr / ltr NO NO |
| 443 // vertical-lr / rtl NO YES | 447 // vertical-lr / rtl NO YES |
| 444 // vertical-rl / ltr YES NO | 448 // vertical-rl / ltr YES NO |
| 445 // vertical-rl / rtl YES YES | 449 // vertical-rl / rtl YES YES |
| 446 IntPoint m_scrollOrigin; | 450 IntPoint m_scrollOrigin; |
| 447 }; | 451 }; |
| 448 | 452 |
| 449 } // namespace blink | 453 } // namespace blink |
| 450 | 454 |
| 451 #endif // ScrollableArea_h | 455 #endif // ScrollableArea_h |
| OLD | NEW |