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

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: Fixing unittests Created 5 years, 7 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 event_to_coalesce, 456 event_to_coalesce,
457 &event); 457 &event);
458 } 458 }
459 459
460 void WebInputEventTraits::Coalesce(const WebInputEvent& event_to_coalesce, 460 void WebInputEventTraits::Coalesce(const WebInputEvent& event_to_coalesce,
461 WebInputEvent* event) { 461 WebInputEvent* event) {
462 DCHECK(event); 462 DCHECK(event);
463 Apply(WebInputEventCoalesce(), event->type, event_to_coalesce, event); 463 Apply(WebInputEventCoalesce(), event->type, event_to_coalesce, event);
464 } 464 }
465 465
466 bool WebInputEventTraits::IgnoresAckDisposition(const WebInputEvent& event) { 466 bool WebInputEventTraits::WillReceiveAckFromRenderer(
467 const WebInputEvent& event) {
467 switch (event.type) { 468 switch (event.type) {
468 case WebInputEvent::MouseDown: 469 case WebInputEvent::MouseDown:
469 case WebInputEvent::MouseUp: 470 case WebInputEvent::MouseUp:
470 case WebInputEvent::MouseEnter: 471 case WebInputEvent::MouseEnter:
471 case WebInputEvent::MouseLeave: 472 case WebInputEvent::MouseLeave:
472 case WebInputEvent::ContextMenu: 473 case WebInputEvent::ContextMenu:
473 case WebInputEvent::GestureScrollBegin: 474 case WebInputEvent::GestureScrollBegin:
474 case WebInputEvent::GestureScrollEnd: 475 case WebInputEvent::GestureScrollEnd:
475 case WebInputEvent::GestureShowPress: 476 case WebInputEvent::GestureShowPress:
476 case WebInputEvent::GestureTapUnconfirmed: 477 case WebInputEvent::GestureTapUnconfirmed:
477 case WebInputEvent::GestureTapDown: 478 case WebInputEvent::GestureTapDown:
478 case WebInputEvent::GestureTapCancel: 479 case WebInputEvent::GestureTapCancel:
479 case WebInputEvent::GesturePinchBegin: 480 case WebInputEvent::GesturePinchBegin:
480 case WebInputEvent::GesturePinchEnd: 481 case WebInputEvent::GesturePinchEnd:
481 case WebInputEvent::TouchCancel: 482 case WebInputEvent::TouchCancel:
483 return false;
484 case WebInputEvent::TouchStart:
485 case WebInputEvent::TouchEnd:
486 return static_cast<const WebTouchEvent&>(event).cancelable;
487 default:
482 return true; 488 return true;
483 case WebInputEvent::TouchStart:
484 case WebInputEvent::TouchMove:
485 case WebInputEvent::TouchEnd:
486 return !static_cast<const WebTouchEvent&>(event).cancelable;
487 default:
488 return false;
489 } 489 }
490 } 490 }
491 491
492 uint32 WebInputEventTraits::GetUniqueTouchEventId(const WebInputEvent& event) {
493 if (WebInputEvent::isTouchEventType(event.type)) {
494 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId;
495 }
496 return 0U;
497 }
498
492 } // namespace content 499 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698