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

Side by Side Diff: Source/platform/scroll/ScrollableArea.cpp

Issue 146003002: Bindings for CSSOM View smooth scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments 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
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (verticalScrollbar) { 181 if (verticalScrollbar) {
182 verticalScrollbar->offsetDidChange(); 182 verticalScrollbar->offsetDidChange();
183 if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrol lbar()) 183 if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrol lbar())
184 verticalScrollbar->invalidate(); 184 verticalScrollbar->invalidate();
185 } 185 }
186 186
187 if (scrollPosition() != oldPosition) 187 if (scrollPosition() != oldPosition)
188 scrollAnimator()->notifyContentAreaScrolled(scrollPosition() - oldPositi on); 188 scrollAnimator()->notifyContentAreaScrolled(scrollPosition() - oldPositi on);
189 } 189 }
190 190
191 bool ScrollableArea::scrollBehaviorFromString(const String& behaviorString, Scro llBehavior& behavior)
192 {
193 if (behaviorString == "auto")
194 behavior = ScrollBehaviorAuto;
195 else if (behaviorString == "instant")
196 behavior = ScrollBehaviorInstant;
197 else if (behaviorString == "smooth")
198 behavior = ScrollBehaviorSmooth;
199 else
200 return false;
201
202 return true;
203 }
204
191 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent) 205 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
192 { 206 {
193 return scrollAnimator()->handleWheelEvent(wheelEvent); 207 return scrollAnimator()->handleWheelEvent(wheelEvent);
194 } 208 }
195 209
196 // NOTE: Only called from Internals for testing. 210 // NOTE: Only called from Internals for testing.
197 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset) 211 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset)
198 { 212 {
199 setScrollOffsetFromAnimation(offset); 213 setScrollOffsetFromAnimation(offset);
200 } 214 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 { 414 {
401 return scrollSize(orientation); 415 return scrollSize(orientation);
402 } 416 }
403 417
404 float ScrollableArea::pixelStep(ScrollbarOrientation) const 418 float ScrollableArea::pixelStep(ScrollbarOrientation) const
405 { 419 {
406 return 1; 420 return 1;
407 } 421 }
408 422
409 } // namespace WebCore 423 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698