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

Side by Side Diff: third_party/WebKit/Source/platform/FrameViewBase.h

Issue 2722953003: Part 1 to rename platform/Widget to platform/FrameViewBase. (Closed)
Patch Set: Created 3 years, 9 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.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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 FrameViewBase_h
29 #define Widget_h 29 #define FrameViewBase_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 "platform/heap/Handle.h"
35 #include "public/platform/WebFocusType.h" 35 #include "public/platform/WebFocusType.h"
36 #include "wtf/Forward.h" 36 #include "wtf/Forward.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 class CullRect; 40 class CullRect;
41 class Event; 41 class Event;
42 class GraphicsContext; 42 class GraphicsContext;
43 43
44 // The Widget class serves as a base class for FrameView, Scrollbar, and 44 // The FrameViewBase class serves as a base class for FrameView, Scrollbar, and
45 // PluginView. 45 // PluginView.
46 // 46 //
47 // Widgets are connected in a hierarchy, with the restriction that plugins and 47 // FrameViewBases are connected in a hierarchy, with the restriction that plugin s and
48 // scrollbars are always leaves of the tree. Only FrameView can have children 48 // scrollbars are always leaves of the tree. Only FrameView can have children
49 // (and therefore the Widget class has no concept of children). 49 // (and therefore the FrameViewBase class has no concept of children).
50 class PLATFORM_EXPORT Widget : public GarbageCollectedFinalized<Widget> { 50 class PLATFORM_EXPORT FrameViewBase : public GarbageCollectedFinalized<FrameView Base> {
51 public: 51 public:
52 Widget(); 52 FrameViewBase();
53 virtual ~Widget(); 53 virtual ~FrameViewBase();
54 54
55 int x() const { return frameRect().x(); } 55 int x() const { return frameRect().x(); }
56 int y() const { return frameRect().y(); } 56 int y() const { return frameRect().y(); }
57 int width() const { return frameRect().width(); } 57 int width() const { return frameRect().width(); }
58 int height() const { return frameRect().height(); } 58 int height() const { return frameRect().height(); }
59 IntSize size() const { return frameRect().size(); } 59 IntSize size() const { return frameRect().size(); }
60 IntPoint location() const { return frameRect().location(); } 60 IntPoint location() const { return frameRect().location(); }
61 61
62 virtual void setFrameRect(const IntRect& frameRect) { 62 virtual void setFrameRect(const IntRect& frameRect) {
63 m_frameRect = frameRect; 63 m_frameRect = frameRect;
(...skipping 23 matching lines...) Expand all
87 } // Whether or not we are actually visible. 87 } // Whether or not we are actually visible.
88 virtual void setParentVisible(bool visible) { m_parentVisible = visible; } 88 virtual void setParentVisible(bool visible) { m_parentVisible = visible; }
89 void setSelfVisible(bool v) { m_selfVisible = v; } 89 void setSelfVisible(bool v) { m_selfVisible = v; }
90 90
91 virtual bool isFrameView() const { return false; } 91 virtual bool isFrameView() const { return false; }
92 virtual bool isRemoteFrameView() const { return false; } 92 virtual bool isRemoteFrameView() const { return false; }
93 virtual bool isPluginView() const { return false; } 93 virtual bool isPluginView() const { return false; }
94 virtual bool isPluginContainer() const { return false; } 94 virtual bool isPluginContainer() const { return false; }
95 virtual bool isScrollbar() const { return false; } 95 virtual bool isScrollbar() const { return false; }
96 96
97 virtual void setParent(Widget*); 97 virtual void setParent(FrameViewBase *);
98 Widget* parent() const { return m_parent; } 98 FrameViewBase* parent() const { return m_parent; }
99 Widget* root() const; 99 FrameViewBase* root() const;
100 100
101 virtual void handleEvent(Event*) {} 101 virtual void handleEvent(Event*) {}
102 102
103 IntRect convertToRootFrame(const IntRect&) const; 103 IntRect convertToRootFrame(const IntRect&) const;
104 IntRect convertFromRootFrame(const IntRect&) const; 104 IntRect convertFromRootFrame(const IntRect&) const;
105 105
106 IntPoint convertToRootFrame(const IntPoint&) const; 106 IntPoint convertToRootFrame(const IntPoint&) const;
107 IntPoint convertFromRootFrame(const IntPoint&) const; 107 IntPoint convertFromRootFrame(const IntPoint&) const;
108 FloatPoint convertFromRootFrame(const FloatPoint&) const; 108 FloatPoint convertFromRootFrame(const FloatPoint&) const;
109 109
110 virtual void frameRectsChanged() {} 110 virtual void frameRectsChanged() {}
111 111
112 virtual void widgetGeometryMayHaveChanged() {} 112 virtual void widgetGeometryMayHaveChanged() {}
113 113
114 virtual IntRect convertToContainingWidget(const IntRect&) const; 114 virtual IntRect convertToContainingWidget(const IntRect&) const;
115 virtual IntRect convertFromContainingWidget(const IntRect&) const; 115 virtual IntRect convertFromContainingWidget(const IntRect&) const;
116 virtual IntPoint convertToContainingWidget(const IntPoint&) const; 116 virtual IntPoint convertToContainingWidget(const IntPoint&) const;
117 virtual IntPoint convertFromContainingWidget(const IntPoint&) const; 117 virtual IntPoint convertFromContainingWidget(const IntPoint&) const;
118 118
119 // Virtual methods to convert points to/from child widgets 119 // Virtual methods to convert points to/from child frameviewbases.
120 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; 120 virtual IntPoint convertChildToSelf(const FrameViewBase *, const IntPoint&) co nst;
121 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; 121 virtual IntPoint convertSelfToChild(const FrameViewBase *, const IntPoint&) co nst;
122 122
123 // Notifies this widget that it will no longer be receiving events. 123 // Notifies this frameviewbase that it will no longer be receiving events.
124 virtual void eventListenersRemoved() {} 124 virtual void eventListenersRemoved() {}
125 125
126 DECLARE_VIRTUAL_TRACE(); 126 DECLARE_VIRTUAL_TRACE();
127 virtual void dispose() {} 127 virtual void dispose() {}
128 128
129 private: 129 private:
130 Member<Widget> m_parent; 130 Member<FrameViewBase> m_parent;
131 IntRect m_frameRect; 131 IntRect m_frameRect;
132 bool m_selfVisible; 132 bool m_selfVisible;
133 bool m_parentVisible; 133 bool m_parentVisible;
134 }; 134 };
135 135
136 } // namespace blink 136 } // namespace blink
137 137
138 #endif // Widget_h 138 #endif // FrameViewBase_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/FrameViewBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698