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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 "InputHandlerProxy::ExtendBoostedFlingTimeout", | 750 "InputHandlerProxy::ExtendBoostedFlingTimeout", |
751 TRACE_EVENT_SCOPE_THREAD); | 751 TRACE_EVENT_SCOPE_THREAD); |
752 deferred_fling_cancel_time_seconds_ = | 752 deferred_fling_cancel_time_seconds_ = |
753 event.timeStampSeconds + kFlingBoostTimeoutDelaySeconds; | 753 event.timeStampSeconds + kFlingBoostTimeoutDelaySeconds; |
754 last_fling_boost_event_ = event; | 754 last_fling_boost_event_ = event; |
755 } | 755 } |
756 | 756 |
757 void InputHandlerProxy::Animate(base::TimeTicks time) { | 757 void InputHandlerProxy::Animate(base::TimeTicks time) { |
758 // If using synchronous animate, then only expect Animate attempts started by | 758 // If using synchronous animate, then only expect Animate attempts started by |
759 // the synchronous system. Don't let the InputHandler try to Animate also. | 759 // the synchronous system. Don't let the InputHandler try to Animate also. |
760 DCHECK(!input_handler_->IsCurrentlyScrollingInnerViewport() || | 760 DCHECK_IMPLIES(input_handler_->IsCurrentlyScrollingInnerViewport(), |
761 allow_root_animate_); | 761 allow_root_animate_); |
762 | 762 |
763 if (scroll_elasticity_controller_) | 763 if (scroll_elasticity_controller_) |
764 scroll_elasticity_controller_->Animate(time); | 764 scroll_elasticity_controller_->Animate(time); |
765 | 765 |
766 if (!fling_curve_) | 766 if (!fling_curve_) |
767 return; | 767 return; |
768 | 768 |
769 last_fling_animate_time_ = time; | 769 last_fling_animate_time_ = time; |
770 double monotonic_time_sec = InSecondsF(time); | 770 double monotonic_time_sec = InSecondsF(time); |
771 | 771 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 1039 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
1040 // Return true in this case to prevent early fling termination. | 1040 // Return true in this case to prevent early fling termination. |
1041 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 1041 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
1042 std::abs(clipped_increment.height) < kScrollEpsilon) | 1042 std::abs(clipped_increment.height) < kScrollEpsilon) |
1043 return true; | 1043 return true; |
1044 | 1044 |
1045 return did_scroll; | 1045 return did_scroll; |
1046 } | 1046 } |
1047 | 1047 |
1048 } // namespace content | 1048 } // namespace content |
OLD | NEW |