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

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

Issue 230663004: Fix WebKeyboardEvent interruption of compositor scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 6 years, 8 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/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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 if (touch_event.touches[i].state != WebTouchPoint::StatePressed) 243 if (touch_event.touches[i].state != WebTouchPoint::StatePressed)
244 continue; 244 continue;
245 if (input_handler_->HaveTouchEventHandlersAt( 245 if (input_handler_->HaveTouchEventHandlersAt(
246 gfx::Point(touch_event.touches[i].position.x, 246 gfx::Point(touch_event.touches[i].position.x,
247 touch_event.touches[i].position.y))) { 247 touch_event.touches[i].position.y))) {
248 return DID_NOT_HANDLE; 248 return DID_NOT_HANDLE;
249 } 249 }
250 } 250 }
251 return DROP_EVENT; 251 return DROP_EVENT;
252 } else if (WebInputEvent::isKeyboardEventType(event.type)) { 252 } else if (WebInputEvent::isKeyboardEventType(event.type)) {
253 CancelCurrentFling(true); 253 // Only call |CancelCurrentFling()| if a fling was active, as it will
254 // otherwise disrupt an in-progress touch scroll.
255 if (fling_curve_)
256 CancelCurrentFling(true);
254 } else if (event.type == WebInputEvent::MouseMove) { 257 } else if (event.type == WebInputEvent::MouseMove) {
255 const WebMouseEvent& mouse_event = 258 const WebMouseEvent& mouse_event =
256 *static_cast<const WebMouseEvent*>(&event); 259 *static_cast<const WebMouseEvent*>(&event);
257 // TODO(tony): Ignore when mouse buttons are down? 260 // TODO(tony): Ignore when mouse buttons are down?
258 // TODO(davemoore): This should never happen, but bug #326635 showed some 261 // TODO(davemoore): This should never happen, but bug #326635 showed some
259 // surprising crashes. 262 // surprising crashes.
260 CHECK(input_handler_); 263 CHECK(input_handler_);
261 input_handler_->MouseMoveAt(gfx::Point(mouse_event.x, mouse_event.y)); 264 input_handler_->MouseMoveAt(gfx::Point(mouse_event.x, mouse_event.y));
262 } 265 }
263 266
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 512
510 if (did_scroll) { 513 if (did_scroll) {
511 fling_parameters_.cumulativeScroll.width += clipped_increment.width; 514 fling_parameters_.cumulativeScroll.width += clipped_increment.width;
512 fling_parameters_.cumulativeScroll.height += clipped_increment.height; 515 fling_parameters_.cumulativeScroll.height += clipped_increment.height;
513 } 516 }
514 517
515 return did_scroll; 518 return did_scroll;
516 } 519 }
517 520
518 } // namespace content 521 } // 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