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

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

Issue 62443007: Replace old with new synthetic gesture framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: opt_mouse_move_event_x/y -> opt_start_x/y Created 7 years, 1 month 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/synthetic_gesture_target_base.h" 5 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
6 6
7 #include "content/browser/renderer_host/render_widget_host_impl.h" 7 #include "content/browser/renderer_host/render_widget_host_impl.h"
8 #include "content/browser/renderer_host/render_widget_host_view_base.h" 8 #include "content/browser/renderer_host/render_widget_host_view_base.h"
9 #include "content/browser/renderer_host/ui_events_helper.h" 9 #include "content/browser/renderer_host/ui_events_helper.h"
10 #include "content/common/input/input_event.h" 10 #include "content/common/input/input_event.h"
11 #include "content/common/input_messages.h"
11 #include "third_party/WebKit/public/web/WebInputEvent.h" 12 #include "third_party/WebKit/public/web/WebInputEvent.h"
12 #include "ui/events/event.h" 13 #include "ui/events/event.h"
13 #include "ui/events/latency_info.h" 14 #include "ui/events/latency_info.h"
14 15
15 using blink::WebInputEvent; 16 using blink::WebInputEvent;
16 using blink::WebTouchEvent; 17 using blink::WebTouchEvent;
17 using blink::WebMouseEvent; 18 using blink::WebMouseEvent;
18 using blink::WebMouseWheelEvent; 19 using blink::WebMouseWheelEvent;
19 20
20 namespace content { 21 namespace content {
21 22
22 SyntheticGestureTargetBase::SyntheticGestureTargetBase( 23 SyntheticGestureTargetBase::SyntheticGestureTargetBase(
23 RenderWidgetHostImpl* host) 24 RenderWidgetHostImpl* host)
24 : host_(host) { 25 : host_(host) {
26 DCHECK(host);
25 } 27 }
26 28
27 SyntheticGestureTargetBase::~SyntheticGestureTargetBase() { 29 SyntheticGestureTargetBase::~SyntheticGestureTargetBase() {
28 } 30 }
29 31
30 void SyntheticGestureTargetBase::DispatchInputEventToPlatform( 32 void SyntheticGestureTargetBase::DispatchInputEventToPlatform(
31 const InputEvent& event) { 33 const InputEvent& event) {
32 const WebInputEvent* web_event = event.web_event.get(); 34 const WebInputEvent* web_event = event.web_event.get();
33 if (WebInputEvent::isTouchEventType(web_event->type)) { 35 if (WebInputEvent::isTouchEventType(web_event->type)) {
34 DCHECK(SupportsSyntheticGestureSourceType( 36 DCHECK(SupportsSyntheticGestureSourceType(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 72 }
71 73
72 void SyntheticGestureTargetBase::DispatchWebMouseEventToPlatform( 74 void SyntheticGestureTargetBase::DispatchWebMouseEventToPlatform(
73 const blink::WebMouseEvent& web_mouse, 75 const blink::WebMouseEvent& web_mouse,
74 const ui::LatencyInfo& latency_info) { 76 const ui::LatencyInfo& latency_info) {
75 host_->ForwardMouseEventWithLatencyInfo( 77 host_->ForwardMouseEventWithLatencyInfo(
76 MouseEventWithLatencyInfo(web_mouse, latency_info)); 78 MouseEventWithLatencyInfo(web_mouse, latency_info));
77 } 79 }
78 80
79 void SyntheticGestureTargetBase::OnSyntheticGestureCompleted( 81 void SyntheticGestureTargetBase::OnSyntheticGestureCompleted(
80 SyntheticGestureNew::Result result) { 82 SyntheticGesture::Result result) {
83 host_->Send(new InputMsg_SyntheticGestureCompleted(host_->GetRoutingID()));
81 } 84 }
82 85
83 void SyntheticGestureTargetBase::SetNeedsFlush() { 86 void SyntheticGestureTargetBase::SetNeedsFlush() {
84 host_->SetNeedsFlush(); 87 host_->SetNeedsFlush();
85 } 88 }
86 89
87 SyntheticGestureParams::GestureSourceType 90 SyntheticGestureParams::GestureSourceType
88 SyntheticGestureTargetBase::GetDefaultSyntheticGestureSourceType() const { 91 SyntheticGestureTargetBase::GetDefaultSyntheticGestureSourceType() const {
89 return SyntheticGestureParams::MOUSE_INPUT; 92 return SyntheticGestureParams::MOUSE_INPUT;
90 } 93 }
91 94
92 bool SyntheticGestureTargetBase::SupportsSyntheticGestureSourceType( 95 bool SyntheticGestureTargetBase::SupportsSyntheticGestureSourceType(
93 SyntheticGestureParams::GestureSourceType gesture_source_type) const { 96 SyntheticGestureParams::GestureSourceType gesture_source_type) const {
94 return gesture_source_type == SyntheticGestureParams::MOUSE_INPUT || 97 return gesture_source_type == SyntheticGestureParams::MOUSE_INPUT ||
95 gesture_source_type == SyntheticGestureParams::TOUCH_INPUT; 98 gesture_source_type == SyntheticGestureParams::TOUCH_INPUT;
96 } 99 }
97 100
98 } // namespace content 101 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698