Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / Widget.h
index ffe2ac6..14e700c 100644 (file)
@@ -31,6 +31,7 @@
 #include "platform/PlatformExport.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/heap/Handle.h"
 #include "wtf/Forward.h"
 #include "wtf/RefCounted.h"
 
@@ -40,15 +41,12 @@ class Event;
 class GraphicsContext;
 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)
+// The Widget class serves as a base class for FrameView, Scrollbar, and 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
+// scrollbars are always leaves of the tree. Only FrameView can have children
 // (and therefore the Widget class has no concept of children).
-class PLATFORM_EXPORT Widget : public RefCounted<Widget> {
+class PLATFORM_EXPORT Widget : public RefCountedWillBeGarbageCollectedFinalized<Widget> {
 public:
     Widget();
     virtual ~Widget();
@@ -89,7 +87,6 @@ public:
     virtual bool isPluginContainer() const { return false; }
     virtual bool pluginShouldPersist() const { return false; }
     virtual bool isScrollbar() const { return false; }
-    virtual bool isScrollView() const { return false; }
 
     virtual HostWindow* hostWindow() const { ASSERT_NOT_REACHED(); return 0; }
     virtual void setParent(Widget*);
@@ -114,7 +111,7 @@ public:
     // Notifies this widget that other widgets on the page have been repositioned.
     virtual void widgetPositionsUpdated() { }
 
-    // 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;
     virtual IntRect convertFromContainingView(const IntRect&) const;
     virtual IntPoint convertToContainingView(const IntPoint&) const;
@@ -127,12 +124,11 @@ public:
     // Notifies this widget that it will no longer be receiving events.
     virtual void eventListenersRemoved() { }
 
-#if ENABLE(OILPAN)
-    virtual void detach() { }
-#endif
+    virtual void trace(Visitor*);
+    virtual void dispose() { }
 
 private:
-    Widget* m_parent;
+    RawPtrWillBeMember<Widget> m_parent;
     IntRect m_frame;
     bool m_selfVisible;
     bool m_parentVisible;