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

Unified Diff: third_party/WebKit/Source/platform/FrameViewBase.cpp

Issue 2722953003: Part 1 to rename platform/Widget to platform/FrameViewBase. (Closed)
Patch Set: Created 3 years, 10 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 | « third_party/WebKit/Source/platform/FrameViewBase.h ('k') | third_party/WebKit/Source/platform/HostWindow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/FrameViewBase.cpp
diff --git a/third_party/WebKit/Source/platform/Widget.cpp b/third_party/WebKit/Source/platform/FrameViewBase.cpp
similarity index 58%
rename from third_party/WebKit/Source/platform/Widget.cpp
rename to third_party/WebKit/Source/platform/FrameViewBase.cpp
index 7176f54c1984f8cdd704d128d85554b73e7f8541..538f3c3feb6d1e85c02288c903c2354100870eae 100644
--- a/third_party/WebKit/Source/platform/Widget.cpp
+++ b/third_party/WebKit/Source/platform/FrameViewBase.cpp
@@ -24,66 +24,66 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "platform/Widget.h"
+#include "platform/FrameViewBase.h"
#include "wtf/Assertions.h"
namespace blink {
-Widget::Widget()
+FrameViewBase::FrameViewBase()
: m_parent(nullptr), m_selfVisible(false), m_parentVisible(false) {}
-Widget::~Widget() {}
+FrameViewBase::~FrameViewBase() {}
-DEFINE_TRACE(Widget) {
+DEFINE_TRACE(FrameViewBase) {
visitor->trace(m_parent);
}
-void Widget::setParent(Widget* widget) {
- ASSERT(!widget || !m_parent);
- if (!widget || !widget->isVisible())
+void FrameViewBase::setParent(FrameViewBase* frameViewBase) {
+ DCHECK(!frameViewBase || !m_parent);
+ if (!frameViewBase || !frameViewBase->isVisible())
setParentVisible(false);
- m_parent = widget;
- if (widget && widget->isVisible())
+ m_parent = frameViewBase;
+ if (frameViewBase && frameViewBase->isVisible())
setParentVisible(true);
}
-Widget* Widget::root() const {
- const Widget* top = this;
+FrameViewBase* FrameViewBase::root() const {
+ const FrameViewBase* top = this;
while (top->parent())
top = top->parent();
if (top->isFrameView())
- return const_cast<Widget*>(static_cast<const Widget*>(top));
+ return const_cast<FrameViewBase*>(static_cast<const FrameViewBase*>(top));
return 0;
}
-IntRect Widget::convertFromRootFrame(const IntRect& rectInRootFrame) const {
- if (const Widget* parentWidget = parent()) {
- IntRect parentRect = parentWidget->convertFromRootFrame(rectInRootFrame);
+IntRect FrameViewBase::convertFromRootFrame(const IntRect& rectInRootFrame) const {
+ if (const FrameViewBase* parentFrameViewBase = parent()) {
+ IntRect parentRect = parentFrameViewBase->convertFromRootFrame(rectInRootFrame);
return convertFromContainingWidget(parentRect);
}
return rectInRootFrame;
}
-IntRect Widget::convertToRootFrame(const IntRect& localRect) const {
- if (const Widget* parentWidget = parent()) {
+IntRect FrameViewBase::convertToRootFrame(const IntRect& localRect) const {
+ if (const FrameViewBase* parentFrameViewBase = parent()) {
IntRect parentRect = convertToContainingWidget(localRect);
- return parentWidget->convertToRootFrame(parentRect);
+ return parentFrameViewBase->convertToRootFrame(parentRect);
}
return localRect;
}
-IntPoint Widget::convertFromRootFrame(const IntPoint& pointInRootFrame) const {
- if (const Widget* parentWidget = parent()) {
- IntPoint parentPoint = parentWidget->convertFromRootFrame(pointInRootFrame);
+IntPoint FrameViewBase::convertFromRootFrame(const IntPoint& pointInRootFrame) const {
+ if (const FrameViewBase* parentFrameViewBase = parent()) {
+ IntPoint parentPoint = parentFrameViewBase->convertFromRootFrame(pointInRootFrame);
return convertFromContainingWidget(parentPoint);
}
return pointInRootFrame;
}
-FloatPoint Widget::convertFromRootFrame(
+FloatPoint FrameViewBase::convertFromRootFrame(
const FloatPoint& pointInRootFrame) const {
- // Widgets / windows are required to be IntPoint aligned, but we may need to
+ // FrameViewBase / windows are required to be IntPoint aligned, but we may need to
// convert FloatPoint values within them (eg. for event co-ordinates).
IntPoint flooredPoint = flooredIntPoint(pointInRootFrame);
FloatPoint parentPoint = this->convertFromRootFrame(flooredPoint);
@@ -102,56 +102,56 @@ FloatPoint Widget::convertFromRootFrame(
return parentPoint;
}
-IntPoint Widget::convertToRootFrame(const IntPoint& localPoint) const {
- if (const Widget* parentWidget = parent()) {
+IntPoint FrameViewBase::convertToRootFrame(const IntPoint& localPoint) const {
+ if (const FrameViewBase* parentFrameViewBase = parent()) {
IntPoint parentPoint = convertToContainingWidget(localPoint);
- return parentWidget->convertToRootFrame(parentPoint);
+ return parentFrameViewBase->convertToRootFrame(parentPoint);
}
return localPoint;
}
-IntRect Widget::convertToContainingWidget(const IntRect& localRect) const {
- if (const Widget* parentWidget = parent()) {
+IntRect FrameViewBase::convertToContainingWidget(const IntRect& localRect) const {
+ if (const FrameViewBase* parentFrameViewBase = parent()) {
IntRect parentRect(localRect);
parentRect.setLocation(
- parentWidget->convertChildToSelf(this, localRect.location()));
+ parentFrameViewBase->convertChildToSelf(this, localRect.location()));
return parentRect;
}
return localRect;
}
-IntRect Widget::convertFromContainingWidget(const IntRect& parentRect) const {
- if (const Widget* parentWidget = parent()) {
+IntRect FrameViewBase::convertFromContainingWidget(const IntRect& parentRect) const {
+ if (const FrameViewBase* parentFrameViewBase = parent()) {
IntRect localRect = parentRect;
localRect.setLocation(
- parentWidget->convertSelfToChild(this, localRect.location()));
+ parentFrameViewBase->convertSelfToChild(this, localRect.location()));
return localRect;
}
return parentRect;
}
-IntPoint Widget::convertToContainingWidget(const IntPoint& localPoint) const {
- if (const Widget* parentWidget = parent())
- return parentWidget->convertChildToSelf(this, localPoint);
+IntPoint FrameViewBase::convertToContainingWidget(const IntPoint& localPoint) const {
+ if (const FrameViewBase* parentFrameViewBase = parent())
+ return parentFrameViewBase->convertChildToSelf(this, localPoint);
return localPoint;
}
-IntPoint Widget::convertFromContainingWidget(
+IntPoint FrameViewBase::convertFromContainingWidget(
const IntPoint& parentPoint) const {
- if (const Widget* parentWidget = parent())
- return parentWidget->convertSelfToChild(this, parentPoint);
+ if (const FrameViewBase* parentFrameViewBase = parent())
+ return parentFrameViewBase->convertSelfToChild(this, parentPoint);
return parentPoint;
}
-IntPoint Widget::convertChildToSelf(const Widget*,
+IntPoint FrameViewBase::convertChildToSelf(const FrameViewBase*,
const IntPoint& point) const {
return point;
}
-IntPoint Widget::convertSelfToChild(const Widget*,
+IntPoint FrameViewBase::convertSelfToChild(const FrameViewBase*,
const IntPoint& point) const {
return point;
}
« no previous file with comments | « third_party/WebKit/Source/platform/FrameViewBase.h ('k') | third_party/WebKit/Source/platform/HostWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698