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

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

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
« sky/engine/core/rendering/RenderObject.cpp ('K') | « sky/engine/platform/Widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/platform/Widget.cpp
diff --git a/sky/engine/platform/Widget.cpp b/sky/engine/platform/Widget.cpp
index 40683290a2d131a13cd49484700840d7975dc20a..e275cf7afe09cfdaa5cbdbdd8e207772d9a5fa04 100644
--- a/sky/engine/platform/Widget.cpp
+++ b/sky/engine/platform/Widget.cpp
@@ -34,8 +34,6 @@ namespace blink {
Widget::Widget()
: m_parent(0)
- , m_selfVisible(false)
- , m_parentVisible(false)
{
}
@@ -44,16 +42,6 @@ Widget::~Widget()
ASSERT(!parent());
}
-void Widget::setParent(Widget* widget)
-{
- ASSERT(!widget || !m_parent);
- if (!widget || !widget->isVisible())
- setParentVisible(false);
- m_parent = widget;
- if (widget && widget->isVisible())
- setParentVisible(true);
-}
-
Widget* Widget::root() const
{
const Widget* top = this;
@@ -127,6 +115,7 @@ IntPoint Widget::convertFromContainingWindow(const IntPoint& windowPoint) const
return windowPoint;
}
+
FloatPoint Widget::convertFromContainingWindow(const FloatPoint& windowPoint) const
{
// Widgets / windows are required to be IntPoint aligned, but we may need to convert
@@ -157,49 +146,22 @@ IntPoint Widget::convertToContainingWindow(const IntPoint& localPoint) const
IntRect Widget::convertToContainingView(const IntRect& localRect) const
{
- if (const Widget* parentWidget = parent()) {
- IntRect parentRect(localRect);
- parentRect.setLocation(parentWidget->convertChildToSelf(this, localRect.location()));
- return parentRect;
- }
return localRect;
}
IntRect Widget::convertFromContainingView(const IntRect& parentRect) const
{
- if (const Widget* parentWidget = parent()) {
- IntRect localRect = parentRect;
- localRect.setLocation(parentWidget->convertSelfToChild(this, localRect.location()));
- return localRect;
- }
-
return parentRect;
}
IntPoint Widget::convertToContainingView(const IntPoint& localPoint) const
{
- if (const Widget* parentWidget = parent())
- return parentWidget->convertChildToSelf(this, localPoint);
-
return localPoint;
}
IntPoint Widget::convertFromContainingView(const IntPoint& parentPoint) const
{
- if (const Widget* parentWidget = parent())
- return parentWidget->convertSelfToChild(this, parentPoint);
-
return parentPoint;
}
-IntPoint Widget::convertChildToSelf(const Widget*, const IntPoint& point) const
-{
- return point;
-}
-
-IntPoint Widget::convertSelfToChild(const Widget*, const IntPoint& point) const
-{
- return point;
-}
-
} // namespace blink
« sky/engine/core/rendering/RenderObject.cpp ('K') | « sky/engine/platform/Widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698