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

Side by Side Diff: Source/platform/scroll/ScrollView.h

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Holger Hans Peter Freyther 3 * Copyright (C) 2009 Holger Hans Peter Freyther
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 IntPoint adjustScrollPositionWithinRange(const IntPoint&) const; 153 IntPoint adjustScrollPositionWithinRange(const IntPoint&) const;
154 int scrollX() const { return scrollPosition().x(); } 154 int scrollX() const { return scrollPosition().x(); }
155 int scrollY() const { return scrollPosition().y(); } 155 int scrollY() const { return scrollPosition().y(); }
156 156
157 virtual IntSize overhangAmount() const OVERRIDE; 157 virtual IntSize overhangAmount() const OVERRIDE;
158 158
159 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition( ); } 159 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition( ); }
160 IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; } 160 IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; }
161 161
162 // Functions for scrolling the view. 162 // Functions for scrolling the view.
163 virtual void setScrollPosition(const IntPoint&); 163 virtual void setScrollPosition(const IntPoint&, ScrollBehavior = ScrollBehav iorInstant);
164 void scrollBy(const IntSize& s) { return setScrollPosition(scrollPosition() + s); } 164 void scrollBy(const IntSize& s, ScrollBehavior behavior = ScrollBehaviorInst ant)
165 {
166 return setScrollPosition(scrollPosition() + s, behavior);
167 }
165 168
166 bool scroll(ScrollDirection, ScrollGranularity); 169 bool scroll(ScrollDirection, ScrollGranularity);
167 170
168 // Scroll the actual contents of the view (either blitting or invalidating a s needed). 171 // Scroll the actual contents of the view (either blitting or invalidating a s needed).
169 void scrollContents(const IntSize& scrollDelta); 172 void scrollContents(const IntSize& scrollDelta);
170 173
171 // This gives us a means of blocking painting on our scrollbars until the fi rst layout has occurred. 174 // This gives us a means of blocking painting on our scrollbars until the fi rst layout has occurred.
172 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal se); 175 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal se);
173 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } 176 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; }
174 177
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 void updateOverhangAreas(); 337 void updateOverhangAreas();
335 338
336 virtual int pageStep(ScrollbarOrientation) const OVERRIDE; 339 virtual int pageStep(ScrollbarOrientation) const OVERRIDE;
337 }; // class ScrollView 340 }; // class ScrollView
338 341
339 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS crollView()); 342 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS crollView());
340 343
341 } // namespace WebCore 344 } // namespace WebCore
342 345
343 #endif // ScrollView_h 346 #endif // ScrollView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698