| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" | 5 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 auto scroller = make_scoped_ptr(new Scroller(Scroller::Config())); | 33 auto scroller = make_scoped_ptr(new Scroller(Scroller::Config())); |
| 34 scroller->Fling(0, | 34 scroller->Fling(0, |
| 35 0, | 35 0, |
| 36 initial_velocity.x(), | 36 initial_velocity.x(), |
| 37 initial_velocity.y(), | 37 initial_velocity.y(), |
| 38 INT_MIN, | 38 INT_MIN, |
| 39 INT_MAX, | 39 INT_MAX, |
| 40 INT_MIN, | 40 INT_MIN, |
| 41 INT_MAX, | 41 INT_MAX, |
| 42 base::TimeTicks()); | 42 base::TimeTicks()); |
| 43 return scroller.Pass(); | 43 return std::move(scroller); |
| 44 #else | 44 #else |
| 45 return make_scoped_ptr( | 45 return make_scoped_ptr( |
| 46 new FlingCurve(initial_velocity, base::TimeTicks())); | 46 new FlingCurve(initial_velocity, base::TimeTicks())); |
| 47 #endif | 47 #endif |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 // static | 52 // static |
| 53 scoped_ptr<WebGestureCurve> WebGestureCurveImpl::CreateFromDefaultPlatformCurve( | 53 scoped_ptr<WebGestureCurve> WebGestureCurveImpl::CreateFromDefaultPlatformCurve( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return still_active; | 136 return still_active; |
| 137 | 137 |
| 138 // scrollBy() could delete this curve if the animation is over, so don't touch | 138 // scrollBy() could delete this curve if the animation is over, so don't touch |
| 139 // any member variables after making that call. | 139 // any member variables after making that call. |
| 140 bool did_scroll = target->scrollBy(blink::WebFloatSize(delta), | 140 bool did_scroll = target->scrollBy(blink::WebFloatSize(delta), |
| 141 blink::WebFloatSize(velocity)); | 141 blink::WebFloatSize(velocity)); |
| 142 return did_scroll && still_active; | 142 return did_scroll && still_active; |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace ui | 145 } // namespace ui |
| OLD | NEW |