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

Unified Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.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
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
index ec956d704c42703e51975686b523788e74b96243..ddc3aff96939ab72d4626090f4a4313c6dba8d6d 100644
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
@@ -569,34 +569,27 @@ bool Scrollbar::IsWindowActive() const {
return scrollable_area_ && scrollable_area_->IsActive();
}
-IntRect Scrollbar::ConvertToContainingFrameViewBase(
- const IntRect& local_rect) const {
- if (scrollable_area_) {
- return scrollable_area_->ConvertFromScrollbarToContainingFrameViewBase(
- *this, local_rect);
- }
-
- return FrameViewBase::ConvertToContainingFrameViewBase(local_rect);
-}
-
-IntRect Scrollbar::ConvertFromContainingFrameViewBase(
- const IntRect& parent_rect) const {
- if (scrollable_area_) {
- return scrollable_area_->ConvertFromContainingFrameViewBaseToScrollbar(
- *this, parent_rect);
+IntPoint Scrollbar::ConvertFromRootFrame(
+ const IntPoint& point_in_root_frame) const {
+ if (const FrameViewBase* parent = Parent()) {
+ IntPoint parent_point = parent->ConvertFromRootFrame(point_in_root_frame);
+ if (scrollable_area_) {
+ return scrollable_area_->ConvertFromContainingFrameViewBaseToScrollbar(
+ *this, parent_point);
+ }
}
- return FrameViewBase::ConvertFromContainingFrameViewBase(parent_rect);
+ return point_in_root_frame;
}
-IntPoint Scrollbar::ConvertToContainingFrameViewBase(
- const IntPoint& local_point) const {
+IntRect Scrollbar::ConvertToContainingFrameViewBase(
+ const IntRect& local_rect) const {
if (scrollable_area_) {
return scrollable_area_->ConvertFromScrollbarToContainingFrameViewBase(
- *this, local_point);
+ *this, local_rect);
}
- return FrameViewBase::ConvertToContainingFrameViewBase(local_point);
+ return local_rect;
}
IntPoint Scrollbar::ConvertFromContainingFrameViewBase(
@@ -606,7 +599,7 @@ IntPoint Scrollbar::ConvertFromContainingFrameViewBase(
*this, parent_point);
}
- return FrameViewBase::ConvertFromContainingFrameViewBase(parent_point);
+ return parent_point;
}
float Scrollbar::ScrollableAreaCurrentPos() const {
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698