| 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..8973aeedef353f75cffaff517e18614bd6ef5a23 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;
|
| @@ -51,6 +55,11 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
|
| // Sets the header, deleting the previous header.
|
| void SetHeader(View* header);
|
|
|
| + // Sets the background color. The default is white when scrolling with layers,
|
| + // otherwise transparent. An opaque color when scrolling with layers ensures
|
| + // fonts can be drawn with subpixel antialiasing.
|
| + void SetBackgroundColor(SkColor color);
|
| +
|
| // Returns the visible region of the content View.
|
| gfx::Rect GetVisibleRect() const;
|
|
|
| @@ -125,6 +134,20 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
|
| // Update the scrollbars positions given viewport and content sizes.
|
| void UpdateScrollBarPositions();
|
|
|
| + // 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);
|
| +
|
| + // Whether the ScrollView scrolls using ui::Layer APIs.
|
| + bool ScrollsWithLayers() const;
|
| +
|
| + // 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
|
| // |contents_viewport_|.
|
| View* contents_;
|
| @@ -149,6 +172,10 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
|
| int min_height_;
|
| int max_height_;
|
|
|
| + // The background color given to the viewport (for overscroll), and to the
|
| + // contents when scrolling with layers.
|
| + SkColor background_color_;
|
| +
|
| // If true, never show the horizontal scrollbar (even if the contents is wider
|
| // than the viewport).
|
| bool hide_horizontal_scrollbar_;
|
|
|