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

Side by Side Diff: content/browser/renderer_host/input/input_router_impl.cc

Issue 1911373002: Articulate the cancel behavior in the WebTouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 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
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/browser/renderer_host/input/input_router_impl.h" 5 #include "content/browser/renderer_host/input/input_router_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 OfferToHandlers(input_event, latency_info); 361 OfferToHandlers(input_event, latency_info);
362 } 362 }
363 363
364 void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, 364 void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event,
365 const ui::LatencyInfo& latency_info) { 365 const ui::LatencyInfo& latency_info) {
366 output_stream_validator_.Validate(input_event); 366 output_stream_validator_.Validate(input_event);
367 367
368 if (OfferToClient(input_event, latency_info)) 368 if (OfferToClient(input_event, latency_info))
369 return; 369 return;
370 370
371 // Touch events should always indicate in the event whether they are
372 // cancelable (respect ACK disposition) or not except touchmove.
373 bool should_block = WebInputEventTraits::ShouldBlockEventStream(input_event); 371 bool should_block = WebInputEventTraits::ShouldBlockEventStream(input_event);
374
375 OfferToRenderer(input_event, latency_info, 372 OfferToRenderer(input_event, latency_info,
376 should_block 373 should_block
377 ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING 374 ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING
378 : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING); 375 : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING);
379 376
380 if (WebInputEvent::isTouchEventType(input_event.type) && 377 if (WebInputEvent::isTouchEventType(input_event.type) &&
381 input_event.type != WebInputEvent::TouchMove) { 378 input_event.type != WebInputEvent::TouchMove) {
382 const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event); 379 const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event);
383 DCHECK_EQ(should_block, touch.cancelable); 380 DCHECK_EQ(should_block, touch.cancelable);
384 } 381 }
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 639
643 flush_requested_ = false; 640 flush_requested_ = false;
644 client_->DidFlush(); 641 client_->DidFlush();
645 } 642 }
646 643
647 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { 644 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) {
648 frame_tree_node_id_ = frameTreeNodeId; 645 frame_tree_node_id_ = frameTreeNodeId;
649 } 646 }
650 647
651 } // namespace content 648 } // namespace content
OLDNEW
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | content/browser/renderer_host/input/touch_emulator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698