| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 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 20 matching lines...) Expand all Loading... |
| 31 #include "platform/graphics/paint/DisplayItem.h" | 31 #include "platform/graphics/paint/DisplayItem.h" |
| 32 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
| 33 #include "platform/scroll/ScrollTypes.h" | 33 #include "platform/scroll/ScrollTypes.h" |
| 34 #include "platform/scroll/ScrollbarThemeClient.h" | 34 #include "platform/scroll/ScrollbarThemeClient.h" |
| 35 #include "wtf/MathExtras.h" | 35 #include "wtf/MathExtras.h" |
| 36 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class GraphicsContext; | 40 class GraphicsContext; |
| 41 class HostWindow; |
| 41 class IntRect; | 42 class IntRect; |
| 42 class PlatformGestureEvent; | 43 class PlatformGestureEvent; |
| 43 class PlatformMouseEvent; | 44 class PlatformMouseEvent; |
| 44 class ScrollAnimatorBase; | 45 class ScrollAnimatorBase; |
| 45 class ScrollableArea; | 46 class ScrollableArea; |
| 46 class ScrollbarTheme; | 47 class ScrollbarTheme; |
| 47 | 48 |
| 48 class PLATFORM_EXPORT Scrollbar : public Widget, public ScrollbarThemeClient { | 49 class PLATFORM_EXPORT Scrollbar : public Widget, public ScrollbarThemeClient { |
| 49 public: | 50 public: |
| 50 static PassRefPtrWillBeRawPtr<Scrollbar> create(ScrollableArea*, ScrollbarOr
ientation, ScrollbarControlSize); | 51 static PassRefPtrWillBeRawPtr<Scrollbar> create(ScrollableArea*, ScrollbarOr
ientation, ScrollbarControlSize, HostWindow*); |
| 51 | 52 |
| 52 // Theme object ownership remains with the caller and it must outlive the sc
rollbar. | 53 // Theme object ownership remains with the caller and it must outlive the sc
rollbar. |
| 53 static PassRefPtrWillBeRawPtr<Scrollbar> createForTesting(ScrollableArea*, S
crollbarOrientation, ScrollbarControlSize, ScrollbarTheme*); | 54 static PassRefPtrWillBeRawPtr<Scrollbar> createForTesting(ScrollableArea*, S
crollbarOrientation, ScrollbarControlSize, ScrollbarTheme*); |
| 54 | 55 |
| 55 ~Scrollbar() override; | 56 ~Scrollbar() override; |
| 56 | 57 |
| 57 // ScrollbarThemeClient implementation. | 58 // ScrollbarThemeClient implementation. |
| 58 int x() const override { return Widget::x(); } | 59 int x() const override { return Widget::x(); } |
| 59 int y() const override { return Widget::y(); } | 60 int y() const override { return Widget::y(); } |
| 60 int width() const override { return Widget::width(); } | 61 int width() const override { return Widget::width(); } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 void setNeedsPaintInvalidation(ScrollbarPart invalidParts = NoPart); | 171 void setNeedsPaintInvalidation(ScrollbarPart invalidParts = NoPart); |
| 171 | 172 |
| 172 // Promptly unregister from the theme manager + run finalizers of derived Sc
rollbars. | 173 // Promptly unregister from the theme manager + run finalizers of derived Sc
rollbars. |
| 173 EAGERLY_FINALIZE(); | 174 EAGERLY_FINALIZE(); |
| 174 #if ENABLE(OILPAN) | 175 #if ENABLE(OILPAN) |
| 175 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW(); | 176 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW(); |
| 176 #endif | 177 #endif |
| 177 DECLARE_VIRTUAL_TRACE(); | 178 DECLARE_VIRTUAL_TRACE(); |
| 178 | 179 |
| 179 protected: | 180 protected: |
| 180 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol
lbarTheme* = 0); | 181 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, HostW
indow* = 0, ScrollbarTheme* = 0); |
| 181 | 182 |
| 182 void autoscrollTimerFired(Timer<Scrollbar>*); | 183 void autoscrollTimerFired(Timer<Scrollbar>*); |
| 183 void startTimerIfNeeded(double delay); | 184 void startTimerIfNeeded(double delay); |
| 184 void stopTimerIfNeeded(); | 185 void stopTimerIfNeeded(); |
| 185 void autoscrollPressedPart(double delay); | 186 void autoscrollPressedPart(double delay); |
| 186 ScrollDirectionPhysical pressedPartScrollDirectionPhysical(); | 187 ScrollDirectionPhysical pressedPartScrollDirectionPhysical(); |
| 187 ScrollGranularity pressedPartScrollGranularity(); | 188 ScrollGranularity pressedPartScrollGranularity(); |
| 188 | 189 |
| 189 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; | 190 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; |
| 190 ScrollbarOrientation m_orientation; | 191 ScrollbarOrientation m_orientation; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 220 | 221 |
| 221 bool m_trackNeedsRepaint; | 222 bool m_trackNeedsRepaint; |
| 222 bool m_thumbNeedsRepaint; | 223 bool m_thumbNeedsRepaint; |
| 223 }; | 224 }; |
| 224 | 225 |
| 225 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); | 226 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); |
| 226 | 227 |
| 227 } // namespace blink | 228 } // namespace blink |
| 228 | 229 |
| 229 #endif // Scrollbar_h | 230 #endif // Scrollbar_h |
| OLD | NEW |