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

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

Issue 2832883003: Remove unneeded Convert* methods and move many from FrameViewBase to FrameView (Closed)
Patch Set: fix ScrollableArea::ConvertFromScrollbarToContainingFrameViewBase and remove dchecks Created 3 years, 8 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: third_party/WebKit/Source/platform/FrameViewBase.cpp
diff --git a/third_party/WebKit/Source/platform/FrameViewBase.cpp b/third_party/WebKit/Source/platform/FrameViewBase.cpp
index 71e393fd20d36c16f2384b4922996ee0bcf435f6..a2a8f80fd5f4b108e6c7629e09b2f588c97e9d30 100644
--- a/third_party/WebKit/Source/platform/FrameViewBase.cpp
+++ b/third_party/WebKit/Source/platform/FrameViewBase.cpp
@@ -67,14 +67,6 @@ IntRect FrameViewBase::ConvertFromRootFrame(
return rect_in_root_frame;
}
-IntRect FrameViewBase::ConvertToRootFrame(const IntRect& local_rect) const {
- if (const FrameViewBase* parent_frame_view_base = Parent()) {
- IntRect parent_rect = ConvertToContainingFrameViewBase(local_rect);
- return parent_frame_view_base->ConvertToRootFrame(parent_rect);
- }
- return local_rect;
-}
-
IntPoint FrameViewBase::ConvertFromRootFrame(
const IntPoint& point_in_root_frame) const {
if (const FrameViewBase* parent_frame_view_base = Parent()) {
@@ -90,14 +82,14 @@ FloatPoint FrameViewBase::ConvertFromRootFrame(
// FrameViewBase / windows are required to be IntPoint aligned, but we may
// need to convert FloatPoint values within them (eg. for event co-ordinates).
IntPoint floored_point = FlooredIntPoint(point_in_root_frame);
- FloatPoint parent_point = this->ConvertFromRootFrame(floored_point);
+ FloatPoint parent_point = ConvertFromRootFrame(floored_point);
FloatSize window_fraction = point_in_root_frame - floored_point;
// Use linear interpolation handle any fractional value (eg. for iframes
// subject to a transform beyond just a simple translation).
// FIXME: Add FloatPoint variants of all co-ordinate space conversion APIs.
if (!window_fraction.IsEmpty()) {
const int kFactor = 1000;
- IntPoint parent_line_end = this->ConvertFromRootFrame(
+ IntPoint parent_line_end = ConvertFromRootFrame(
floored_point + RoundedIntSize(window_fraction.ScaledBy(kFactor)));
FloatSize parent_fraction =
(parent_line_end - parent_point).ScaledBy(1.0f / kFactor);
@@ -106,61 +98,4 @@ FloatPoint FrameViewBase::ConvertFromRootFrame(
return parent_point;
}
-IntPoint FrameViewBase::ConvertToRootFrame(const IntPoint& local_point) const {
- if (const FrameViewBase* parent_frame_view_base = Parent()) {
- IntPoint parent_point = ConvertToContainingFrameViewBase(local_point);
- return parent_frame_view_base->ConvertToRootFrame(parent_point);
- }
- return local_point;
-}
-
-IntRect FrameViewBase::ConvertToContainingFrameViewBase(
- const IntRect& local_rect) const {
- if (const FrameViewBase* parent_frame_view_base = Parent()) {
- IntRect parent_rect(local_rect);
- parent_rect.SetLocation(parent_frame_view_base->ConvertChildToSelf(
- this, local_rect.Location()));
- return parent_rect;
- }
- return local_rect;
-}
-
-IntRect FrameViewBase::ConvertFromContainingFrameViewBase(
- const IntRect& parent_rect) const {
- if (const FrameViewBase* parent_frame_view_base = Parent()) {
- IntRect local_rect = parent_rect;
- local_rect.SetLocation(parent_frame_view_base->ConvertSelfToChild(
- this, local_rect.Location()));
- return local_rect;
- }
-
- return parent_rect;
-}
-
-IntPoint FrameViewBase::ConvertToContainingFrameViewBase(
- const IntPoint& local_point) const {
- if (const FrameViewBase* parent_frame_view_base = Parent())
- return parent_frame_view_base->ConvertChildToSelf(this, local_point);
-
- return local_point;
-}
-
-IntPoint FrameViewBase::ConvertFromContainingFrameViewBase(
- const IntPoint& parent_point) const {
- if (const FrameViewBase* parent_frame_view_base = Parent())
- return parent_frame_view_base->ConvertSelfToChild(this, parent_point);
-
- return parent_point;
-}
-
-IntPoint FrameViewBase::ConvertChildToSelf(const FrameViewBase*,
- const IntPoint& point) const {
- return point;
-}
-
-IntPoint FrameViewBase::ConvertSelfToChild(const FrameViewBase*,
- const IntPoint& point) const {
- return point;
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/FrameViewBase.h ('k') | third_party/WebKit/Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698