| Index: ui/views/controls/scroll_view.h
|
| diff --git a/ui/views/controls/scroll_view.h b/ui/views/controls/scroll_view.h
|
| index da384801d9682208c19ae558986b06fdb3bbece9..28c9a12d8e69ac31d38450215f915f1bd0088ff6 100644
|
| --- a/ui/views/controls/scroll_view.h
|
| +++ b/ui/views/controls/scroll_view.h
|
| @@ -12,7 +12,14 @@
|
| #include "base/macros.h"
|
| #include "ui/views/controls/scrollbar/scroll_bar.h"
|
|
|
| +namespace gfx {
|
| +class ScrollOffset;
|
| +}
|
| +
|
| namespace views {
|
| +namespace test {
|
| +class ScrollViewTestApi;
|
| +}
|
|
|
| /////////////////////////////////////////////////////////////////////////////
|
| //
|
| @@ -84,8 +91,10 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
|
| bool OnMouseWheel(const ui::MouseWheelEvent& e) override;
|
| void OnMouseEntered(const ui::MouseEvent& event) override;
|
| void OnMouseExited(const ui::MouseEvent& event) override;
|
| + void OnScrollEvent(ui::ScrollEvent* 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;
|
| @@ -94,7 +103,7 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
|
| bool is_positive) override;
|
|
|
| private:
|
| - FRIEND_TEST_ALL_PREFIXES(ScrollViewTest, CornerViewVisibility);
|
| + friend class test::ScrollViewTestApi;
|
| class Viewport;
|
|
|
| // Used internally by SetHeader() and SetContents() to reset the view. Sets
|
| @@ -121,9 +130,18 @@ 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_|.
|
| + // Gets and sets the current scroll offset.
|
| + gfx::ScrollOffset CurrentOffset() const;
|
| + void ScrollToOffset(const gfx::ScrollOffset& offset);
|
| +
|
| + // Callback entrypoint when hosted layers are scrolled by the compositor.
|
| + void OnLayerScrolled();
|
| +
|
| + // 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.
|
| View* contents_;
|
| + View* contents_container_;
|
| View* contents_viewport_;
|
|
|
| // The current header and its viewport. |header_| is contained in
|
|
|