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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 TRACE_EVENT_INSTANT2("input", | 717 TRACE_EVENT_INSTANT2("input", |
718 fling_boosted ? "InputHandlerProxy::FlingBoosted" | 718 fling_boosted ? "InputHandlerProxy::FlingBoosted" |
719 : "InputHandlerProxy::FlingReplaced", | 719 : "InputHandlerProxy::FlingReplaced", |
720 TRACE_EVENT_SCOPE_THREAD, | 720 TRACE_EVENT_SCOPE_THREAD, |
721 "vx", | 721 "vx", |
722 current_fling_velocity_.x(), | 722 current_fling_velocity_.x(), |
723 "vy", | 723 "vy", |
724 current_fling_velocity_.y()); | 724 current_fling_velocity_.y()); |
725 | 725 |
726 // The client expects balanced calls between a consumed GestureFlingStart | 726 // The client expects balanced calls between a consumed GestureFlingStart |
727 // and |DidStopFlinging()|. TODO(jdduke): Provide a count parameter to | 727 // and |DidStopFlinging()|. |
728 // |DidStopFlinging()| and only send after the accumulated fling ends. | |
729 client_->DidStopFlinging(); | 728 client_->DidStopFlinging(); |
730 return true; | 729 return true; |
731 } | 730 } |
732 | 731 |
733 default: | 732 default: |
734 // All other types of gestures (taps, presses, etc...) will complete the | 733 // All other types of gestures (taps, presses, etc...) will complete the |
735 // deferred fling cancellation. | 734 // deferred fling cancellation. |
736 CancelCurrentFling(); | 735 CancelCurrentFling(); |
737 return false; | 736 return false; |
738 } | 737 } |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 1028 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
1030 // Return true in this case to prevent early fling termination. | 1029 // Return true in this case to prevent early fling termination. |
1031 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 1030 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
1032 std::abs(clipped_increment.height) < kScrollEpsilon) | 1031 std::abs(clipped_increment.height) < kScrollEpsilon) |
1033 return true; | 1032 return true; |
1034 | 1033 |
1035 return did_scroll; | 1034 return did_scroll; |
1036 } | 1035 } |
1037 | 1036 |
1038 } // namespace content | 1037 } // namespace content |
OLD | NEW |