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

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

Issue 1586983004: Revert of Scale scrollbar in use-zoom-for-dsf mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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) 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
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;
42 class IntRect; 41 class IntRect;
43 class PlatformGestureEvent; 42 class PlatformGestureEvent;
44 class PlatformMouseEvent; 43 class PlatformMouseEvent;
45 class ScrollAnimatorBase; 44 class ScrollAnimatorBase;
46 class ScrollableArea; 45 class ScrollableArea;
47 class ScrollbarTheme; 46 class ScrollbarTheme;
48 47
49 class PLATFORM_EXPORT Scrollbar : public Widget, public ScrollbarThemeClient { 48 class PLATFORM_EXPORT Scrollbar : public Widget, public ScrollbarThemeClient {
50 public: 49 public:
51 static PassRefPtrWillBeRawPtr<Scrollbar> create(ScrollableArea*, ScrollbarOr ientation, ScrollbarControlSize, HostWindow*); 50 static PassRefPtrWillBeRawPtr<Scrollbar> create(ScrollableArea*, ScrollbarOr ientation, ScrollbarControlSize);
52 51
53 // Theme object ownership remains with the caller and it must outlive the sc rollbar. 52 // Theme object ownership remains with the caller and it must outlive the sc rollbar.
54 static PassRefPtrWillBeRawPtr<Scrollbar> createForTesting(ScrollableArea*, S crollbarOrientation, ScrollbarControlSize, ScrollbarTheme*); 53 static PassRefPtrWillBeRawPtr<Scrollbar> createForTesting(ScrollableArea*, S crollbarOrientation, ScrollbarControlSize, ScrollbarTheme*);
55 54
56 ~Scrollbar() override; 55 ~Scrollbar() override;
57 56
58 // ScrollbarThemeClient implementation. 57 // ScrollbarThemeClient implementation.
59 int x() const override { return Widget::x(); } 58 int x() const override { return Widget::x(); }
60 int y() const override { return Widget::y(); } 59 int y() const override { return Widget::y(); }
61 int width() const override { return Widget::width(); } 60 int width() const override { return Widget::width(); }
(...skipping 25 matching lines...) Expand all
87 ScrollbarControlSize controlSize() const override { return m_controlSize; } 86 ScrollbarControlSize controlSize() const override { return m_controlSize; }
88 87
89 ScrollbarPart pressedPart() const override { return m_pressedPart; } 88 ScrollbarPart pressedPart() const override { return m_pressedPart; }
90 ScrollbarPart hoveredPart() const override { return m_hoveredPart; } 89 ScrollbarPart hoveredPart() const override { return m_hoveredPart; }
91 90
92 void styleChanged() override { } 91 void styleChanged() override { }
93 void visibilityChanged() override; 92 void visibilityChanged() override;
94 bool enabled() const override { return m_enabled; } 93 bool enabled() const override { return m_enabled; }
95 void setEnabled(bool) override; 94 void setEnabled(bool) override;
96 95
97 int scrollbarThickness() const;
98
99 // Called by the ScrollableArea when the scroll offset changes. 96 // Called by the ScrollableArea when the scroll offset changes.
100 void offsetDidChange(); 97 void offsetDidChange();
101 98
102 void disconnectFromScrollableArea(); 99 void disconnectFromScrollableArea();
103 ScrollableArea* scrollableArea() const { return m_scrollableArea; } 100 ScrollableArea* scrollableArea() const { return m_scrollableArea; }
104 101
105 int pressedPos() const { return m_pressedPos; } 102 int pressedPos() const { return m_pressedPos; }
106 103
107 virtual void setHoveredPart(ScrollbarPart); 104 virtual void setHoveredPart(ScrollbarPart);
108 virtual void setPressedPart(ScrollbarPart); 105 virtual void setPressedPart(ScrollbarPart);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void setNeedsPaintInvalidation(ScrollbarPart invalidParts = NoPart); 170 void setNeedsPaintInvalidation(ScrollbarPart invalidParts = NoPart);
174 171
175 // Promptly unregister from the theme manager + run finalizers of derived Sc rollbars. 172 // Promptly unregister from the theme manager + run finalizers of derived Sc rollbars.
176 EAGERLY_FINALIZE(); 173 EAGERLY_FINALIZE();
177 #if ENABLE(OILPAN) 174 #if ENABLE(OILPAN)
178 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW(); 175 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW();
179 #endif 176 #endif
180 DECLARE_VIRTUAL_TRACE(); 177 DECLARE_VIRTUAL_TRACE();
181 178
182 protected: 179 protected:
183 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, HostW indow* = 0, ScrollbarTheme* = 0); 180 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol lbarTheme* = 0);
184 181
185 void autoscrollTimerFired(Timer<Scrollbar>*); 182 void autoscrollTimerFired(Timer<Scrollbar>*);
186 void startTimerIfNeeded(double delay); 183 void startTimerIfNeeded(double delay);
187 void stopTimerIfNeeded(); 184 void stopTimerIfNeeded();
188 void autoscrollPressedPart(double delay); 185 void autoscrollPressedPart(double delay);
189 ScrollDirectionPhysical pressedPartScrollDirectionPhysical(); 186 ScrollDirectionPhysical pressedPartScrollDirectionPhysical();
190 ScrollGranularity pressedPartScrollGranularity(); 187 ScrollGranularity pressedPartScrollGranularity();
191 188
192 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; 189 RawPtrWillBeMember<ScrollableArea> m_scrollableArea;
193 ScrollbarOrientation m_orientation; 190 ScrollbarOrientation m_orientation;
194 ScrollbarControlSize m_controlSize; 191 ScrollbarControlSize m_controlSize;
195 ScrollbarTheme& m_theme; 192 ScrollbarTheme& m_theme;
196 HostWindow* m_hostWindow;
197 193
198 int m_visibleSize; 194 int m_visibleSize;
199 int m_totalSize; 195 int m_totalSize;
200 float m_currentPos; 196 float m_currentPos;
201 float m_dragOrigin; 197 float m_dragOrigin;
202 198
203 ScrollbarPart m_hoveredPart; 199 ScrollbarPart m_hoveredPart;
204 ScrollbarPart m_pressedPart; 200 ScrollbarPart m_pressedPart;
205 int m_pressedPos; 201 int m_pressedPos;
206 float m_scrollPos; 202 float m_scrollPos;
(...skipping 17 matching lines...) Expand all
224 220
225 bool m_trackNeedsRepaint; 221 bool m_trackNeedsRepaint;
226 bool m_thumbNeedsRepaint; 222 bool m_thumbNeedsRepaint;
227 }; 223 };
228 224
229 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr ollbar()); 225 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr ollbar());
230 226
231 } // namespace blink 227 } // namespace blink
232 228
233 #endif // Scrollbar_h 229 #endif // Scrollbar_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698