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

Side by Side Diff: WebCore/platform/Scrollbar.h

Issue 3364013: Merge 67001 - 2010-09-08 Peter Kasting <pkasting@google.com>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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
« no previous file with comments | « WebCore/platform/ScrollView.cpp ('k') | WebCore/platform/Scrollbar.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24 matching lines...) Expand all
35 namespace WebCore { 35 namespace WebCore {
36 36
37 class GraphicsContext; 37 class GraphicsContext;
38 class IntRect; 38 class IntRect;
39 class ScrollbarClient; 39 class ScrollbarClient;
40 class ScrollbarTheme; 40 class ScrollbarTheme;
41 class PlatformMouseEvent; 41 class PlatformMouseEvent;
42 42
43 class Scrollbar : public Widget { 43 class Scrollbar : public Widget {
44 public: 44 public:
45 enum ScrollSource {
46 FromScrollAnimator,
47 NotFromScrollAnimator,
48 };
49
45 virtual ~Scrollbar(); 50 virtual ~Scrollbar();
46 51
47 // Must be implemented by platforms that can't simply use the Scrollbar base class. Right now the only platform that is not using the base class is GTK. 52 // Must be implemented by platforms that can't simply use the Scrollbar base class. Right now the only platform that is not using the base class is GTK.
48 static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size); 53 static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size);
49 54
50 static int pixelsPerLineStep() { return 40; } 55 static int pixelsPerLineStep() { return 40; }
51 static float minFractionToStepWhenPaging() { return 0.875f; } 56 static float minFractionToStepWhenPaging() { return 0.875f; }
52 static int maxOverlapBetweenPages(); 57 static int maxOverlapBetweenPages();
53 58
54 void setClient(ScrollbarClient* client) { m_client = client; } 59 void setClient(ScrollbarClient* client) { m_client = client; }
(...skipping 13 matching lines...) Expand all
68 int lineStep() const { return m_lineStep; } 73 int lineStep() const { return m_lineStep; }
69 int pageStep() const { return m_pageStep; } 74 int pageStep() const { return m_pageStep; }
70 float pixelStep() const { return m_pixelStep; } 75 float pixelStep() const { return m_pixelStep; }
71 76
72 ScrollbarPart pressedPart() const { return m_pressedPart; } 77 ScrollbarPart pressedPart() const { return m_pressedPart; }
73 ScrollbarPart hoveredPart() const { return m_hoveredPart; } 78 ScrollbarPart hoveredPart() const { return m_hoveredPart; }
74 virtual void setHoveredPart(ScrollbarPart); 79 virtual void setHoveredPart(ScrollbarPart);
75 virtual void setPressedPart(ScrollbarPart); 80 virtual void setPressedPart(ScrollbarPart);
76 81
77 void setSteps(int lineStep, int pageStep, int pixelsPerStep = 1); 82 void setSteps(int lineStep, int pageStep, int pixelsPerStep = 1);
78 bool setValue(int); 83 bool setValue(int, ScrollSource source);
79 void setProportion(int visibleSize, int totalSize); 84 void setProportion(int visibleSize, int totalSize);
80 void setPressedPos(int p) { m_pressedPos = p; } 85 void setPressedPos(int p) { m_pressedPos = p; }
81 86
82 bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1); 87 bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
83 88
84 virtual void paint(GraphicsContext*, const IntRect& damageRect); 89 virtual void paint(GraphicsContext*, const IntRect& damageRect);
85 90
86 bool enabled() const { return m_enabled; } 91 bool enabled() const { return m_enabled; }
87 virtual void setEnabled(bool e); 92 virtual void setEnabled(bool e);
88 93
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 bool m_enabled; 165 bool m_enabled;
161 166
162 Timer<Scrollbar> m_scrollTimer; 167 Timer<Scrollbar> m_scrollTimer;
163 bool m_overlapsResizer; 168 bool m_overlapsResizer;
164 169
165 bool m_suppressInvalidation; 170 bool m_suppressInvalidation;
166 171
167 private: 172 private:
168 virtual bool isScrollbar() const { return true; } 173 virtual bool isScrollbar() const { return true; }
169 174
170 bool setCurrentPos(float pos); 175 bool setCurrentPos(float pos, ScrollSource source);
171 }; 176 };
172 177
173 } 178 }
174 179
175 #endif 180 #endif
OLDNEW
« no previous file with comments | « WebCore/platform/ScrollView.cpp ('k') | WebCore/platform/Scrollbar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698