| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void setNeedsPaintInvalidation(); | 158 void setNeedsPaintInvalidation(); |
| 158 | 159 |
| 159 // Promptly unregister from the theme manager + run finalizers of derived Sc
rollbars. | 160 // Promptly unregister from the theme manager + run finalizers of derived Sc
rollbars. |
| 160 EAGERLY_FINALIZE(); | 161 EAGERLY_FINALIZE(); |
| 161 #if ENABLE(OILPAN) | 162 #if ENABLE(OILPAN) |
| 162 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW(); | 163 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW(); |
| 163 #endif | 164 #endif |
| 164 DECLARE_VIRTUAL_TRACE(); | 165 DECLARE_VIRTUAL_TRACE(); |
| 165 | 166 |
| 166 protected: | 167 protected: |
| 167 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol
lbarTheme* = 0); | 168 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, HostW
indow* = 0, ScrollbarTheme* = 0); |
| 168 | 169 |
| 169 void updateThumb(); | 170 void updateThumb(); |
| 170 | 171 |
| 171 void autoscrollTimerFired(Timer<Scrollbar>*); | 172 void autoscrollTimerFired(Timer<Scrollbar>*); |
| 172 void startTimerIfNeeded(double delay); | 173 void startTimerIfNeeded(double delay); |
| 173 void stopTimerIfNeeded(); | 174 void stopTimerIfNeeded(); |
| 174 void autoscrollPressedPart(double delay); | 175 void autoscrollPressedPart(double delay); |
| 175 ScrollDirectionPhysical pressedPartScrollDirectionPhysical(); | 176 ScrollDirectionPhysical pressedPartScrollDirectionPhysical(); |
| 176 ScrollGranularity pressedPartScrollGranularity(); | 177 ScrollGranularity pressedPartScrollGranularity(); |
| 177 | 178 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 213 |
| 213 bool m_trackNeedsRepaint; | 214 bool m_trackNeedsRepaint; |
| 214 bool m_thumbNeedsRepaint; | 215 bool m_thumbNeedsRepaint; |
| 215 }; | 216 }; |
| 216 | 217 |
| 217 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); | 218 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); |
| 218 | 219 |
| 219 } // namespace blink | 220 } // namespace blink |
| 220 | 221 |
| 221 #endif // Scrollbar_h | 222 #endif // Scrollbar_h |
| OLD | NEW |