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

Side by Side Diff: content/renderer/input/input_handler_proxy.cc

Issue 1028533004: Reset scroll status when a fling is ignored (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years, 9 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
« no previous file with comments | « no previous file | content/renderer/input/input_handler_proxy_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 fling_parameters_.sourceDevice = gesture_event.sourceDevice; 522 fling_parameters_.sourceDevice = gesture_event.sourceDevice;
523 input_handler_->SetNeedsAnimate(); 523 input_handler_->SetNeedsAnimate();
524 return DID_HANDLE; 524 return DID_HANDLE;
525 } 525 }
526 case cc::InputHandler::SCROLL_UNKNOWN: 526 case cc::InputHandler::SCROLL_UNKNOWN:
527 case cc::InputHandler::SCROLL_ON_MAIN_THREAD: { 527 case cc::InputHandler::SCROLL_ON_MAIN_THREAD: {
528 TRACE_EVENT_INSTANT0("input", 528 TRACE_EVENT_INSTANT0("input",
529 "InputHandlerProxy::HandleGestureFling::" 529 "InputHandlerProxy::HandleGestureFling::"
530 "scroll_on_main_thread", 530 "scroll_on_main_thread",
531 TRACE_EVENT_SCOPE_THREAD); 531 TRACE_EVENT_SCOPE_THREAD);
532 gesture_scroll_on_impl_thread_ = false;
532 fling_may_be_active_on_main_thread_ = true; 533 fling_may_be_active_on_main_thread_ = true;
533 return DID_NOT_HANDLE; 534 return DID_NOT_HANDLE;
534 } 535 }
535 case cc::InputHandler::SCROLL_IGNORED: { 536 case cc::InputHandler::SCROLL_IGNORED: {
536 TRACE_EVENT_INSTANT0( 537 TRACE_EVENT_INSTANT0(
537 "input", 538 "input",
538 "InputHandlerProxy::HandleGestureFling::ignored", 539 "InputHandlerProxy::HandleGestureFling::ignored",
539 TRACE_EVENT_SCOPE_THREAD); 540 TRACE_EVENT_SCOPE_THREAD);
541 gesture_scroll_on_impl_thread_ = false;
540 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) { 542 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) {
541 // We still pass the curve to the main thread if there's nothing 543 // We still pass the curve to the main thread if there's nothing
542 // scrollable, in case something 544 // scrollable, in case something
543 // registers a handler before the curve is over. 545 // registers a handler before the curve is over.
544 return DID_NOT_HANDLE; 546 return DID_NOT_HANDLE;
545 } 547 }
546 return DROP_EVENT; 548 return DROP_EVENT;
547 } 549 }
548 case cc::InputHandler::ScrollStatusCount: 550 case cc::InputHandler::ScrollStatusCount:
549 NOTREACHED(); 551 NOTREACHED();
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 // trigger a scroll, e.g., with a trivial time delta between fling updates. 943 // trigger a scroll, e.g., with a trivial time delta between fling updates.
942 // Return true in this case to prevent early fling termination. 944 // Return true in this case to prevent early fling termination.
943 if (std::abs(clipped_increment.width) < kScrollEpsilon && 945 if (std::abs(clipped_increment.width) < kScrollEpsilon &&
944 std::abs(clipped_increment.height) < kScrollEpsilon) 946 std::abs(clipped_increment.height) < kScrollEpsilon)
945 return true; 947 return true;
946 948
947 return did_scroll; 949 return did_scroll;
948 } 950 }
949 951
950 } // namespace content 952 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/input/input_handler_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698