| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 [_trackAlphaAnimation.get() invalidate]; | 666 [_trackAlphaAnimation.get() invalidate]; |
| 667 [_uiStateTransitionAnimation.get() invalidate]; | 667 [_uiStateTransitionAnimation.get() invalidate]; |
| 668 [_expansionTransitionAnimation.get() invalidate]; | 668 [_expansionTransitionAnimation.get() invalidate]; |
| 669 END_BLOCK_OBJC_EXCEPTIONS; | 669 END_BLOCK_OBJC_EXCEPTIONS; |
| 670 } | 670 } |
| 671 | 671 |
| 672 @end | 672 @end |
| 673 | 673 |
| 674 namespace blink { | 674 namespace blink { |
| 675 | 675 |
| 676 RawPtr<ScrollAnimatorBase> ScrollAnimatorBase::create(ScrollableArea* scrollable
Area) | 676 ScrollAnimatorBase* ScrollAnimatorBase::create(ScrollableArea* scrollableArea) |
| 677 { | 677 { |
| 678 return new ScrollAnimatorMac(scrollableArea); | 678 return new ScrollAnimatorMac(scrollableArea); |
| 679 } | 679 } |
| 680 | 680 |
| 681 ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea) | 681 ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea) |
| 682 : ScrollAnimatorBase(scrollableArea) | 682 : ScrollAnimatorBase(scrollableArea) |
| 683 , m_initialScrollbarPaintTaskFactory(CancellableTaskFactory::create(this, &S
crollAnimatorMac::initialScrollbarPaintTask)) | 683 , m_initialScrollbarPaintTaskFactory(CancellableTaskFactory::create(this, &S
crollAnimatorMac::initialScrollbarPaintTask)) |
| 684 , m_sendContentAreaScrolledTaskFactory(CancellableTaskFactory::create(this,
&ScrollAnimatorMac::sendContentAreaScrolledTask)) | 684 , m_sendContentAreaScrolledTaskFactory(CancellableTaskFactory::create(this,
&ScrollAnimatorMac::sendContentAreaScrolledTask)) |
| 685 , m_taskRunner(adoptPtr(Platform::current()->currentThread()->scheduler()->t
imerTaskRunner()->clone())) | 685 , m_taskRunner(adoptPtr(Platform::current()->currentThread()->scheduler()->t
imerTaskRunner()->clone())) |
| 686 , m_haveScrolledSincePageLoad(false) | 686 , m_haveScrolledSincePageLoad(false) |
| 687 , m_needsScrollerStyleUpdate(false) | 687 , m_needsScrollerStyleUpdate(false) |
| 688 { | 688 { |
| 689 #if ENABLE(OILPAN) | |
| 690 ThreadState::current()->registerPreFinalizer(this); | 689 ThreadState::current()->registerPreFinalizer(this); |
| 691 #endif | |
| 692 | 690 |
| 693 m_scrollAnimationHelperDelegate.adoptNS([[BlinkScrollAnimationHelperDelegate
alloc] initWithScrollAnimator:this]); | 691 m_scrollAnimationHelperDelegate.adoptNS([[BlinkScrollAnimationHelperDelegate
alloc] initWithScrollAnimator:this]); |
| 694 m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelpe
r") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]); | 692 m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelpe
r") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]); |
| 695 | 693 |
| 696 m_scrollbarPainterControllerDelegate.adoptNS([[BlinkScrollbarPainterControll
erDelegate alloc] initWithScrollableArea:scrollableArea]); | 694 m_scrollbarPainterControllerDelegate.adoptNS([[BlinkScrollbarPainterControll
erDelegate alloc] initWithScrollableArea:scrollableArea]); |
| 697 m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair") al
loc] init] autorelease]; | 695 m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair") al
loc] init] autorelease]; |
| 698 [m_scrollbarPainterController.get() performSelector:@selector(setDelegate:)
withObject:m_scrollbarPainterControllerDelegate.get()]; | 696 [m_scrollbarPainterController.get() performSelector:@selector(setDelegate:)
withObject:m_scrollbarPainterControllerDelegate.get()]; |
| 699 [m_scrollbarPainterController.get() setScrollerStyle:ScrollbarThemeMac::reco
mmendedScrollerStyle()]; | 697 [m_scrollbarPainterController.get() setScrollerStyle:ScrollbarThemeMac::reco
mmendedScrollerStyle()]; |
| 700 } | 698 } |
| 701 | 699 |
| 702 ScrollAnimatorMac::~ScrollAnimatorMac() | 700 ScrollAnimatorMac::~ScrollAnimatorMac() |
| 703 { | 701 { |
| 704 #if !ENABLE(OILPAN) | |
| 705 dispose(); | |
| 706 #endif | |
| 707 } | 702 } |
| 708 | 703 |
| 709 void ScrollAnimatorMac::dispose() | 704 void ScrollAnimatorMac::dispose() |
| 710 { | 705 { |
| 711 BEGIN_BLOCK_OBJC_EXCEPTIONS; | 706 BEGIN_BLOCK_OBJC_EXCEPTIONS; |
| 712 [m_scrollbarPainterControllerDelegate.get() invalidate]; | 707 [m_scrollbarPainterControllerDelegate.get() invalidate]; |
| 713 [m_scrollbarPainterController.get() setDelegate:nil]; | 708 [m_scrollbarPainterController.get() setDelegate:nil]; |
| 714 [m_horizontalScrollbarPainterDelegate.get() invalidate]; | 709 [m_horizontalScrollbarPainterDelegate.get() invalidate]; |
| 715 [m_verticalScrollbarPainterDelegate.get() invalidate]; | 710 [m_verticalScrollbarPainterDelegate.get() invalidate]; |
| 716 [m_scrollAnimationHelperDelegate.get() invalidate]; | 711 [m_scrollAnimationHelperDelegate.get() invalidate]; |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar()) | 1100 if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar()) |
| 1106 rectInViewCoordinates = verticalScrollbar->convertToContainingWidget(scr
ollerThumb); | 1101 rectInViewCoordinates = verticalScrollbar->convertToContainingWidget(scr
ollerThumb); |
| 1107 | 1102 |
| 1108 if (rectInViewCoordinates == m_visibleScrollerThumbRect) | 1103 if (rectInViewCoordinates == m_visibleScrollerThumbRect) |
| 1109 return; | 1104 return; |
| 1110 | 1105 |
| 1111 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1106 m_visibleScrollerThumbRect = rectInViewCoordinates; |
| 1112 } | 1107 } |
| 1113 | 1108 |
| 1114 } // namespace blink | 1109 } // namespace blink |
| OLD | NEW |