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

Side by Side Diff: Source/core/platform/Scrollbar.h

Issue 26936002: Remove Widget's dependency upon its own inheritor aka ScrollView. This was nasty from an OO design… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Fix for clang compile error Created 7 years, 2 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 | « Source/core/platform/ScrollView.cpp ('k') | Source/core/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 17 matching lines...) Expand all
28 28
29 #include "core/platform/Widget.h" 29 #include "core/platform/Widget.h"
30 #include "platform/Timer.h" 30 #include "platform/Timer.h"
31 #include "platform/scroll/ScrollTypes.h" 31 #include "platform/scroll/ScrollTypes.h"
32 #include "platform/scroll/ScrollbarThemeClient.h" 32 #include "platform/scroll/ScrollbarThemeClient.h"
33 #include "wtf/MathExtras.h" 33 #include "wtf/MathExtras.h"
34 #include "wtf/PassRefPtr.h" 34 #include "wtf/PassRefPtr.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 class AXObjectCache;
38 class GraphicsContext; 39 class GraphicsContext;
39 class IntRect; 40 class IntRect;
40 class PlatformGestureEvent; 41 class PlatformGestureEvent;
41 class PlatformMouseEvent; 42 class PlatformMouseEvent;
42 class ScrollableArea; 43 class ScrollableArea;
43 class ScrollbarTheme; 44 class ScrollbarTheme;
45 class ScrollView;
44 46
45 class Scrollbar : public Widget, 47 class Scrollbar : public Widget,
46 public ScrollbarThemeClient { 48 public ScrollbarThemeClient {
47 49
48 public: 50 public:
49 static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation, S crollbarControlSize); 51 static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation, S crollbarControlSize);
50 52
51 virtual ~Scrollbar(); 53 virtual ~Scrollbar();
52 54
53 // ScrollbarThemeClient implementation. 55 // ScrollbarThemeClient implementation.
54 virtual int x() const { return Widget::x(); } 56 virtual int x() const { return Widget::x(); }
55 virtual int y() const { return Widget::y(); } 57 virtual int y() const { return Widget::y(); }
56 virtual int width() const { return Widget::width(); } 58 virtual int width() const { return Widget::width(); }
57 virtual int height() const { return Widget::height(); } 59 virtual int height() const { return Widget::height(); }
58 virtual IntSize size() const { return Widget::size(); } 60 virtual IntSize size() const { return Widget::size(); }
59 virtual IntPoint location() const { return Widget::location(); } 61 virtual IntPoint location() const { return Widget::location(); }
60 62
61 virtual ScrollView* parent() const { return Widget::parent(); } 63 virtual Widget* parent() const { return Widget::parent(); }
62 virtual ScrollView* root() const { return Widget::root(); } 64 virtual Widget* root() const { return Widget::root(); }
65
66 void removeFromParent();
67 ScrollView* parentScrollView() const;
68 ScrollView* rootScrollView() const;
63 69
64 virtual void setFrameRect(const IntRect&); 70 virtual void setFrameRect(const IntRect&);
65 virtual IntRect frameRect() const { return Widget::frameRect(); } 71 virtual IntRect frameRect() const { return Widget::frameRect(); }
66 72
67 virtual void invalidate() { Widget::invalidate(); } 73 virtual void invalidate() { Widget::invalidate(); }
68 virtual void invalidateRect(const IntRect&); 74 virtual void invalidateRect(const IntRect&);
69 75
70 virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const; 76 virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const;
71 virtual void getTickmarks(Vector<IntRect>&) const; 77 virtual void getTickmarks(Vector<IntRect>&) const;
72 virtual bool isScrollableAreaActive() const; 78 virtual bool isScrollableAreaActive() const;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 void mouseMoved(const PlatformMouseEvent&); 128 void mouseMoved(const PlatformMouseEvent&);
123 void mouseEntered(); 129 void mouseEntered();
124 void mouseExited(); 130 void mouseExited();
125 131
126 // Used by some platform scrollbars to know when they've been released from capture. 132 // Used by some platform scrollbars to know when they've been released from capture.
127 void mouseUp(const PlatformMouseEvent&); 133 void mouseUp(const PlatformMouseEvent&);
128 void mouseDown(const PlatformMouseEvent&); 134 void mouseDown(const PlatformMouseEvent&);
129 135
130 ScrollbarTheme* theme() const { return m_theme; } 136 ScrollbarTheme* theme() const { return m_theme; }
131 137
132 virtual void setParent(ScrollView*); 138 virtual void setParent(Widget*) OVERRIDE;
133 139
134 bool suppressInvalidation() const { return m_suppressInvalidation; } 140 bool suppressInvalidation() const { return m_suppressInvalidation; }
135 void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; } 141 void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; }
136 142
137 virtual IntRect convertToContainingView(const IntRect&) const; 143 virtual IntRect convertToContainingView(const IntRect&) const;
138 virtual IntRect convertFromContainingView(const IntRect&) const; 144 virtual IntRect convertFromContainingView(const IntRect&) const;
139 145
140 virtual IntPoint convertToContainingView(const IntPoint&) const; 146 virtual IntPoint convertToContainingView(const IntPoint&) const;
141 virtual IntPoint convertFromContainingView(const IntPoint&) const; 147 virtual IntPoint convertFromContainingView(const IntPoint&) const;
142 148
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollbar()); 209 ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollbar());
204 return static_cast<const Scrollbar*>(widget); 210 return static_cast<const Scrollbar*>(widget);
205 } 211 }
206 212
207 // This will catch anyone doing an unnecessary cast. 213 // This will catch anyone doing an unnecessary cast.
208 void toScrollbar(const Scrollbar*); 214 void toScrollbar(const Scrollbar*);
209 215
210 } // namespace WebCore 216 } // namespace WebCore
211 217
212 #endif // Scrollbar_h 218 #endif // Scrollbar_h
OLDNEW
« no previous file with comments | « Source/core/platform/ScrollView.cpp ('k') | Source/core/platform/Scrollbar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698