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

Side by Side Diff: content/common/input/web_input_event_traits.cc

Issue 997283002: Coalesce async touch move events until the ack back from render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit tests 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
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/common/input/web_input_event_traits.h" 5 #include "content/common/input/web_input_event_traits.h"
6 6
7 #include <bitset> 7 #include <bitset>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 event_to_coalesce, 454 event_to_coalesce,
455 &event); 455 &event);
456 } 456 }
457 457
458 void WebInputEventTraits::Coalesce(const WebInputEvent& event_to_coalesce, 458 void WebInputEventTraits::Coalesce(const WebInputEvent& event_to_coalesce,
459 WebInputEvent* event) { 459 WebInputEvent* event) {
460 DCHECK(event); 460 DCHECK(event);
461 Apply(WebInputEventCoalesce(), event->type, event_to_coalesce, event); 461 Apply(WebInputEventCoalesce(), event->type, event_to_coalesce, event);
462 } 462 }
463 463
464 // For touchmove events, we always need an ACK back from render, and for async
465 // touch move, we will also send a fake ACK.
tdresser 2015/03/25 14:16:18 I'd move this comment down to where we deal with T
lanwei 2015/03/26 11:54:38 Done.
464 bool WebInputEventTraits::IgnoresAckDisposition(const WebInputEvent& event) { 466 bool WebInputEventTraits::IgnoresAckDisposition(const WebInputEvent& event) {
465 switch (event.type) { 467 switch (event.type) {
466 case WebInputEvent::MouseDown: 468 case WebInputEvent::MouseDown:
467 case WebInputEvent::MouseUp: 469 case WebInputEvent::MouseUp:
468 case WebInputEvent::MouseEnter: 470 case WebInputEvent::MouseEnter:
469 case WebInputEvent::MouseLeave: 471 case WebInputEvent::MouseLeave:
470 case WebInputEvent::ContextMenu: 472 case WebInputEvent::ContextMenu:
471 case WebInputEvent::GestureScrollBegin: 473 case WebInputEvent::GestureScrollBegin:
472 case WebInputEvent::GestureScrollEnd: 474 case WebInputEvent::GestureScrollEnd:
473 case WebInputEvent::GestureShowPress: 475 case WebInputEvent::GestureShowPress:
474 case WebInputEvent::GestureTapUnconfirmed: 476 case WebInputEvent::GestureTapUnconfirmed:
475 case WebInputEvent::GestureTapDown: 477 case WebInputEvent::GestureTapDown:
476 case WebInputEvent::GestureTapCancel: 478 case WebInputEvent::GestureTapCancel:
477 case WebInputEvent::GesturePinchBegin: 479 case WebInputEvent::GesturePinchBegin:
478 case WebInputEvent::GesturePinchEnd: 480 case WebInputEvent::GesturePinchEnd:
479 case WebInputEvent::TouchCancel: 481 case WebInputEvent::TouchCancel:
480 return true; 482 return true;
481 case WebInputEvent::TouchStart: 483 case WebInputEvent::TouchStart:
482 case WebInputEvent::TouchMove:
483 case WebInputEvent::TouchEnd: 484 case WebInputEvent::TouchEnd:
484 return !static_cast<const WebTouchEvent&>(event).cancelable; 485 return !static_cast<const WebTouchEvent&>(event).cancelable;
485 default: 486 default:
486 return false; 487 return false;
487 } 488 }
488 } 489 }
489 490
490 } // namespace content 491 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698