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

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: 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 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..fc4f0c19ca8bdf91a2d21f31da16dfeb8345a464 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 ScrollViews can have children
+// (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; }
+ Widget* root() const;
virtual void handleEvent(Event*) { }
@@ -127,14 +127,15 @@ public:
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