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

Unified Diff: Source/core/platform/Widget.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: Clean up by using helper functions where appropriate 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/Scrollbar.cpp ('k') | Source/core/platform/Widget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/Widget.h
diff --git a/Source/core/platform/Widget.h b/Source/core/platform/Widget.h
index 73f2ea22789bc6b470b71e04cd458433e257e452..47d3d61d80617aeb59998006a1245c8b41762906 100644
--- a/Source/core/platform/Widget.h
+++ b/Source/core/platform/Widget.h
@@ -34,19 +34,19 @@
namespace WebCore {
-class AXObjectCache;
class Cursor;
class Event;
class GraphicsContext;
-class ScrollView;
+class HostWindow;
// The Widget class serves as a base class for three kinds of objects:
// (1) Scrollable areas (ScrollView)
// (2) Scrollbars (Scrollbar)
// (3) Plugins (PluginView)
//
-// Widgets are connected in a hierarchy, with the restriction that plugins and scrollbars are always leaves of the
-// tree. Only ScrollViews can have children (and therefore the Widget class has no concept of children).
+// Widgets are connected in a hierarchy, with the restriction that plugins and
+// scrollbars are always leaves of the tree. Only Widgets can have children
eseidel 2013/10/11 15:27:22 "Only ScrollViews can have children" rather...
+// (and therefore the Widget class has no concept of children).
class Widget : public RefCounted<Widget> {
public:
Widget();
@@ -90,10 +90,10 @@ public:
virtual bool isScrollbar() const { return false; }
virtual bool isScrollView() const { return false; }
- void removeFromParent();
- virtual void setParent(ScrollView* view);
- ScrollView* parent() const { return m_parent; }
- ScrollView* root() const;
+ virtual HostWindow* hostWindow() const;
+ virtual void setParent(Widget*);
+ Widget* parent() const { return m_parent; }
eseidel 2013/10/11 15:27:22 Making these SrollView* is fine. It just means th
+ Widget* root() const;
virtual void handleEvent(Event*) { }
@@ -121,20 +121,21 @@ public:
// Notifies this widget that its clip rect changed.
virtual void clipRectChanged() { }
- // Virtual methods to convert points to/from the containing ScrollView
+ // Virtual methods to convert points to/from the containing Widget
virtual IntRect convertToContainingView(const IntRect&) const;
eseidel 2013/10/11 15:27:22 If ScrollView is always the container, why use Wid
virtual IntRect convertFromContainingView(const IntRect&) const;
virtual IntPoint convertToContainingView(const IntPoint&) const;
virtual IntPoint convertFromContainingView(const IntPoint&) const;
- // A means to access the AX cache when this object can get a pointer to it.
- virtual AXObjectCache* axObjectCache() const { return 0; }
+ // Virtual methods to convert points to/from child widgets
+ virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const;
+ virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const;
// Notifies this widget that it will no longer be receiving events.
virtual void eventListenersRemoved() { }
private:
- ScrollView* m_parent;
+ Widget* m_parent;
IntRect m_frame;
bool m_selfVisible;
bool m_parentVisible;
« no previous file with comments | « Source/core/platform/Scrollbar.cpp ('k') | Source/core/platform/Widget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698