| Index: ui/views/controls/scroll_view.h
|
| diff --git a/ui/views/controls/scroll_view.h b/ui/views/controls/scroll_view.h
|
| index 42348fc536898c984b7b767e9cdbdd5f4b03c0e3..d3ab9bc94633221786e33d8c56bfdc7e91c298b3 100644
|
| --- a/ui/views/controls/scroll_view.h
|
| +++ b/ui/views/controls/scroll_view.h
|
| @@ -12,6 +12,10 @@
|
| #include "base/macros.h"
|
| #include "ui/views/controls/scrollbar/scroll_bar.h"
|
|
|
| +namespace gfx {
|
| +class ScrollOffset;
|
| +}
|
| +
|
| namespace views {
|
| namespace test {
|
| class ScrollViewTestApi;
|
| @@ -89,6 +93,7 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
|
| void OnMouseExited(const ui::MouseEvent& event) override;
|
| void OnGestureEvent(ui::GestureEvent* event) override;
|
| const char* GetClassName() const override;
|
| + ScrollView* EnclosingScrollView() override;
|
|
|
| // ScrollBarController overrides:
|
| void ScrollToPosition(ScrollBar* source, int position) override;
|
| @@ -125,9 +130,24 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
|
| // Update the scrollbars positions given viewport and content sizes.
|
| void UpdateScrollBarPositions();
|
|
|
| - // The current contents and its viewport. |contents_| is contained in
|
| - // |contents_viewport_|.
|
| + // Helpers to get and set the current scroll offset (either from the ui::Layer
|
| + // or from the |contents_| origin offset).
|
| + gfx::ScrollOffset CurrentOffset() const;
|
| + void ScrollToOffset(const gfx::ScrollOffset& offset);
|
| +
|
| + // Callback entrypoint when hosted Layers are scrolled by the Compositor.
|
| + void OnLayerScrolled();
|
| +
|
| + // Horizontally scrolls the header (if any) to match the contents.
|
| + void ScrollHeader();
|
| +
|
| + // The current contents and its viewport. |contents_| is contained in the
|
| + // layer-backed |contents_container_| which guarantees it is at least as high
|
| + // and wide as the |contents_viewport_|, which does the clipping. If
|
| + // |contents_container_| is null, the origin of |contents_| is offset to
|
| + // perform scrolling.
|
| View* contents_;
|
| + View* contents_container_;
|
| View* contents_viewport_;
|
|
|
| // The current header and its viewport. |header_| is contained in
|
|
|