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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.h

Issue 2454913003: MainFrame scrollbars should work with RFV instead of FV (Closed)
Patch Set: Fix broken chromeos bot Created 4 years, 1 month 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/scroll/ScrollableArea.h
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.h b/third_party/WebKit/Source/platform/scroll/ScrollableArea.h
index eb2188d991bef84d430ee3ae6369dca28dc90d9a..930a1ceab8ed0256359307d84c37f410e7066ac4 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.h
@@ -109,10 +109,11 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin {
void mouseEnteredContentArea() const;
void mouseExitedContentArea() const;
void mouseMovedInContentArea() const;
- void mouseEnteredScrollbar(Scrollbar&);
- void mouseExitedScrollbar(Scrollbar&);
+ virtual void mouseEnteredScrollbar(Scrollbar&);
+ virtual void mouseExitedScrollbar(Scrollbar&);
void mouseCapturedScrollbar();
void mouseReleasedScrollbar();
+
void contentAreaDidShow() const;
void contentAreaDidHide() const;
@@ -123,10 +124,10 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin {
virtual void contentsResized();
- bool hasOverlayScrollbars() const;
+ virtual bool hasOverlayScrollbars() const;
void setScrollbarOverlayColorTheme(ScrollbarOverlayColorTheme);
void recalculateScrollbarOverlayColorTheme(Color);
- ScrollbarOverlayColorTheme getScrollbarOverlayColorTheme() const {
+ virtual ScrollbarOverlayColorTheme getScrollbarOverlayColorTheme() const {
return static_cast<ScrollbarOverlayColorTheme>(
m_scrollbarOverlayColorTheme);
}
@@ -167,10 +168,10 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin {
virtual bool isActive() const = 0;
virtual int scrollSize(ScrollbarOrientation) const = 0;
- void setScrollbarNeedsPaintInvalidation(ScrollbarOrientation);
+ virtual void setScrollbarNeedsPaintInvalidation(ScrollbarOrientation);
virtual bool isScrollCornerVisible() const = 0;
virtual IntRect scrollCornerRect() const = 0;
- void setScrollCornerNeedsPaintInvalidation();
+ virtual void setScrollCornerNeedsPaintInvalidation();
virtual void getTickmarks(Vector<IntRect>&) const {}
// Convert points and rects between the scrollbar and its containing Widget.
@@ -200,6 +201,12 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin {
virtual Scrollbar* horizontalScrollbar() const { return nullptr; }
virtual Scrollbar* verticalScrollbar() const { return nullptr; }
+ // TODO(crbug.com/661236): This method should be moved to ScrollbarManager
+ // which will update the scrollbars directly for all subclasses.
+ // Called to update the scrollbars to accurately reflect the state of the
+ // view.
+ virtual void updateScrollbars(){};
+
// scrollPosition is the location of the top/left of the scroll viewport in
// the coordinate system defined by the top/left of the overflow rect.
// scrollOffset is the offset of the scroll viewport from its position when
@@ -221,6 +228,9 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin {
virtual ScrollOffset maximumScrollOffset() const {
return ScrollOffset(maximumScrollOffsetInt());
}
+ virtual ScrollOffset scrollAnimatorDesiredTargetOffset() const {
+ return scrollAnimator().desiredTargetOffset();
+ }
virtual IntRect visibleContentRect(
IncludeScrollbarsInRect = ExcludeScrollbars) const;
@@ -231,6 +241,11 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin {
virtual bool shouldSuspendScrollAnimations() const { return true; }
virtual void scrollbarStyleChanged() {}
+ // Called when scrollbar hides/shows for overlay scrollbars. This callback
+ // shouldn't do any significant work as it can be called unexpectadly often
+ // on Mac. This happens because painting code has to set alpha to 1, paint,
+ // then reset to alpha, causing spurrious "visibilityChanged" calls.
+ virtual void scrollbarVisibilityChanged() {}
virtual bool scrollbarsCanBeActive() const = 0;
// Returns the bounding box of this scrollable area, in the coordinate system
@@ -392,12 +407,6 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin {
}
void showOverlayScrollbars();
- // Called when scrollbar hides/shows for overlay scrollbars. This callback
- // shouldn't do any significant work as it can be called unexpectadly often
- // on Mac. This happens because painting code has to set alpha to 1, paint,
- // then reset to alpha, causing spurrious "visibilityChanged" calls.
- virtual void scrollbarVisibilityChanged() {}
-
private:
void programmaticScrollHelper(const ScrollOffset&, ScrollBehavior);
void userScrollHelper(const ScrollOffset&, ScrollBehavior);

Powered by Google App Engine
This is Rietveld 408576698