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

Side by Side Diff: Source/platform/Widget.h

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased upto r183571 Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008 Collabora Ltd. All rights reserved. 3 * Copyright (C) 2008 Collabora Ltd. All rights reserved.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 13 matching lines...) Expand all
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #ifndef Widget_h 28 #ifndef Widget_h
29 #define Widget_h 29 #define Widget_h
30 30
31 #include "platform/PlatformExport.h" 31 #include "platform/PlatformExport.h"
32 #include "platform/geometry/FloatPoint.h" 32 #include "platform/geometry/FloatPoint.h"
33 #include "platform/geometry/IntRect.h" 33 #include "platform/geometry/IntRect.h"
34 #include "platform/heap/Handle.h"
34 #include "wtf/Forward.h" 35 #include "wtf/Forward.h"
35 #include "wtf/RefCounted.h" 36 #include "wtf/RefCounted.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 class Event; 40 class Event;
40 class GraphicsContext; 41 class GraphicsContext;
41 class HostWindow; 42 class HostWindow;
42 43
43 // The Widget class serves as a base class for three kinds of objects: 44 // The Widget class serves as a base class for three kinds of objects:
44 // (1) Scrollable areas (ScrollView) 45 // (1) Scrollable areas (ScrollView)
45 // (2) Scrollbars (Scrollbar) 46 // (2) Scrollbars (Scrollbar)
46 // (3) Plugins (PluginView) 47 // (3) Plugins (PluginView)
47 // 48 //
48 // Widgets are connected in a hierarchy, with the restriction that plugins and 49 // Widgets are connected in a hierarchy, with the restriction that plugins and
49 // scrollbars are always leaves of the tree. Only ScrollViews can have children 50 // scrollbars are always leaves of the tree. Only ScrollViews can have children
50 // (and therefore the Widget class has no concept of children). 51 // (and therefore the Widget class has no concept of children).
51 class PLATFORM_EXPORT Widget : public RefCounted<Widget> { 52 class PLATFORM_EXPORT Widget : public RefCountedWillBeGarbageCollectedFinalized< Widget> {
52 public: 53 public:
53 Widget(); 54 Widget();
54 virtual ~Widget(); 55 virtual ~Widget();
55 56
56 int x() const { return frameRect().x(); } 57 int x() const { return frameRect().x(); }
57 int y() const { return frameRect().y(); } 58 int y() const { return frameRect().y(); }
58 int width() const { return frameRect().width(); } 59 int width() const { return frameRect().width(); }
59 int height() const { return frameRect().height(); } 60 int height() const { return frameRect().height(); }
60 IntSize size() const { return frameRect().size(); } 61 IntSize size() const { return frameRect().size(); }
61 IntPoint location() const { return frameRect().location(); } 62 IntPoint location() const { return frameRect().location(); }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 virtual IntPoint convertToContainingView(const IntPoint&) const; 121 virtual IntPoint convertToContainingView(const IntPoint&) const;
121 virtual IntPoint convertFromContainingView(const IntPoint&) const; 122 virtual IntPoint convertFromContainingView(const IntPoint&) const;
122 123
123 // Virtual methods to convert points to/from child widgets 124 // Virtual methods to convert points to/from child widgets
124 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; 125 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const;
125 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; 126 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const;
126 127
127 // Notifies this widget that it will no longer be receiving events. 128 // Notifies this widget that it will no longer be receiving events.
128 virtual void eventListenersRemoved() { } 129 virtual void eventListenersRemoved() { }
129 130
130 #if ENABLE(OILPAN) 131 virtual void trace(Visitor*);
131 virtual void detach() { } 132 virtual void dispose() { }
haraken 2014/10/11 17:33:03 Can we make this a pure virtual method? (Otherwise
sof 2014/10/12 08:16:22 Prefer to keep it like this, providing a default i
132 #endif
133 133
134 private: 134 private:
135 Widget* m_parent; 135 RawPtrWillBeMember<Widget> m_parent;
136 IntRect m_frame; 136 IntRect m_frame;
137 bool m_selfVisible; 137 bool m_selfVisible;
138 bool m_parentVisible; 138 bool m_parentVisible;
139 }; 139 };
140 140
141 } // namespace blink 141 } // namespace blink
142 142
143 #endif // Widget_h 143 #endif // Widget_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698