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

Unified Diff: ui/views/controls/scroll_view.h

Issue 1680613002: Adding momentum/overscroll to views:: ScrollViews Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Tableview layout. aaaand I think we are done Created 4 years, 5 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 | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698