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

Unified Diff: sky/engine/platform/Widget.h

Issue 691453002: Remove a lot of Widget APIs. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/platform/Widget.h
diff --git a/sky/engine/platform/Widget.h b/sky/engine/platform/Widget.h
index 4e6600ae9174fd7beba73c012f9df20483ae5f5e..b5b33c9e9433a66a2908ff5f75ded4be4996328a 100644
--- a/sky/engine/platform/Widget.h
+++ b/sky/engine/platform/Widget.h
@@ -40,14 +40,7 @@ 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)
-//
-// 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).
+// The Widget class serves as a base class for Scrollbar and FrameView.
class PLATFORM_EXPORT Widget : public RefCounted<Widget> {
public:
Widget();
@@ -73,23 +66,14 @@ public:
void invalidate() { invalidateRect(boundsRect()); }
virtual void invalidateRect(const IntRect&) = 0;
- bool isSelfVisible() const { return m_selfVisible; } // Whether or not we have been explicitly marked as visible or not.
- bool isParentVisible() const { return m_parentVisible; } // Whether or not our parent is visible.
- bool isVisible() const { return m_selfVisible && m_parentVisible; } // Whether or not we are actually visible.
- virtual void setParentVisible(bool visible) { m_parentVisible = visible; }
- void setSelfVisible(bool v) { m_selfVisible = v; }
-
virtual bool isFrameView() 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*);
+ void setParent(Widget* parent) { m_parent = parent; }
Widget* parent() const { return m_parent; }
Widget* root() const;
- virtual void handleEvent(Event*) { }
-
IntRect convertToRootView(const IntRect&) const;
IntRect convertFromRootView(const IntRect&) const;
@@ -113,15 +97,9 @@ public:
virtual IntPoint convertToContainingView(const IntPoint&) const;
virtual IntPoint convertFromContainingView(const IntPoint&) const;
- // 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;
-
private:
Widget* m_parent;
IntRect m_frame;
- bool m_selfVisible;
- bool m_parentVisible;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698