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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 247433003: Mark touchcancel events as uncancelable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avi CR feedback 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_impl.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind_helpers.h" 5 #include "base/bind_helpers.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" 9 #include "content/browser/browser_plugin/browser_plugin_guest.h"
10 #include "content/browser/frame_host/render_widget_host_view_guest.h" 10 #include "content/browser/frame_host/render_widget_host_view_guest.h"
11 #include "content/browser/renderer_host/render_view_host_impl.h" 11 #include "content/browser/renderer_host/render_view_host_impl.h"
12 #include "content/common/browser_plugin/browser_plugin_messages.h" 12 #include "content/common/browser_plugin/browser_plugin_messages.h"
13 #include "content/common/frame_messages.h" 13 #include "content/common/frame_messages.h"
14 #include "content/common/gpu/gpu_messages.h" 14 #include "content/common/gpu/gpu_messages.h"
15 #include "content/common/host_shared_bitmap_manager.h" 15 #include "content/common/host_shared_bitmap_manager.h"
16 #include "content/common/input/web_touch_event_traits.h"
16 #include "content/common/view_messages.h" 17 #include "content/common/view_messages.h"
17 #include "content/common/webplugin_geometry.h" 18 #include "content/common/webplugin_geometry.h"
18 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
19 #include "skia/ext/platform_canvas.h" 20 #include "skia/ext/platform_canvas.h"
20 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 21 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
21 22
22 #if defined(OS_MACOSX) 23 #if defined(OS_MACOSX)
23 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h" 24 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h"
24 #endif 25 #endif
25 26
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 ui::GestureEvent* event) { 525 ui::GestureEvent* event) {
525 ForwardGestureEventToRenderer(event); 526 ForwardGestureEventToRenderer(event);
526 } 527 }
527 528
528 void RenderWidgetHostViewGuest::DispatchCancelTouchEvent( 529 void RenderWidgetHostViewGuest::DispatchCancelTouchEvent(
529 ui::TouchEvent* event) { 530 ui::TouchEvent* event) {
530 if (!host_) 531 if (!host_)
531 return; 532 return;
532 533
533 blink::WebTouchEvent cancel_event; 534 blink::WebTouchEvent cancel_event;
534 cancel_event.type = blink::WebInputEvent::TouchCancel; 535 // TODO(rbyers): This event has no touches in it. Don't we need to know what
535 cancel_event.timeStampSeconds = event->time_stamp().InSecondsF(); 536 // touches are currently active in order to cancel them all properly?
537 WebTouchEventTraits::ResetType(blink::WebInputEvent::TouchCancel,
538 event->time_stamp().InSecondsF(),
539 &cancel_event);
540
536 host_->ForwardTouchEventWithLatencyInfo(cancel_event, *event->latency()); 541 host_->ForwardTouchEventWithLatencyInfo(cancel_event, *event->latency());
537 } 542 }
538 543
539 bool RenderWidgetHostViewGuest::ForwardGestureEventToRenderer( 544 bool RenderWidgetHostViewGuest::ForwardGestureEventToRenderer(
540 ui::GestureEvent* gesture) { 545 ui::GestureEvent* gesture) {
541 #if defined(USE_AURA) 546 #if defined(USE_AURA)
542 if (!host_) 547 if (!host_)
543 return false; 548 return false;
544 549
545 if ((gesture->type() == ui::ET_GESTURE_PINCH_BEGIN || 550 if ((gesture->type() == ui::ET_GESTURE_PINCH_BEGIN ||
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 ++g_it) { 585 ++g_it) {
581 ForwardGestureEventToRenderer(*g_it); 586 ForwardGestureEventToRenderer(*g_it);
582 } 587 }
583 } 588 }
584 589
585 SkBitmap::Config RenderWidgetHostViewGuest::PreferredReadbackFormat() { 590 SkBitmap::Config RenderWidgetHostViewGuest::PreferredReadbackFormat() {
586 return SkBitmap::kARGB_8888_Config; 591 return SkBitmap::kARGB_8888_Config;
587 } 592 }
588 593
589 } // namespace content 594 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698