| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/input/input_handler_proxy.h" | 5 #include "content/renderer/input/input_handler_proxy.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 return DID_NOT_HANDLE; | 344 return DID_NOT_HANDLE; |
| 345 } | 345 } |
| 346 | 346 |
| 347 void InputHandlerProxy::Animate(base::TimeTicks time) { | 347 void InputHandlerProxy::Animate(base::TimeTicks time) { |
| 348 if (!fling_curve_) | 348 if (!fling_curve_) |
| 349 return; | 349 return; |
| 350 | 350 |
| 351 double monotonic_time_sec = InSecondsF(time); | 351 double monotonic_time_sec = InSecondsF(time); |
| 352 if (!fling_parameters_.startTime) { | 352 if (!fling_parameters_.startTime || |
| 353 monotonic_time_sec <= fling_parameters_.startTime) { |
| 353 fling_parameters_.startTime = monotonic_time_sec; | 354 fling_parameters_.startTime = monotonic_time_sec; |
| 354 input_handler_->ScheduleAnimation(); | 355 input_handler_->ScheduleAnimation(); |
| 355 return; | 356 return; |
| 356 } | 357 } |
| 357 | 358 |
| 358 bool fling_is_active = | 359 bool fling_is_active = |
| 359 fling_curve_->apply(monotonic_time_sec - fling_parameters_.startTime, | 360 fling_curve_->apply(monotonic_time_sec - fling_parameters_.startTime, |
| 360 this); | 361 this); |
| 361 | 362 |
| 362 if (disallow_vertical_fling_scroll_ && disallow_horizontal_fling_scroll_) | 363 if (disallow_vertical_fling_scroll_ && disallow_horizontal_fling_scroll_) |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 510 |
| 510 if (did_scroll) { | 511 if (did_scroll) { |
| 511 fling_parameters_.cumulativeScroll.width += clipped_increment.width; | 512 fling_parameters_.cumulativeScroll.width += clipped_increment.width; |
| 512 fling_parameters_.cumulativeScroll.height += clipped_increment.height; | 513 fling_parameters_.cumulativeScroll.height += clipped_increment.height; |
| 513 } | 514 } |
| 514 | 515 |
| 515 return did_scroll; | 516 return did_scroll; |
| 516 } | 517 } |
| 517 | 518 |
| 518 } // namespace content | 519 } // namespace content |
| OLD | NEW |