OLD | NEW |
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/web_input_event_builders_android.h
" | 5 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" |
6 | 6 |
7 #include <android/input.h> | 7 #include <android/input.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/browser/renderer_host/input/web_input_event_util.h" | 10 #include "content/browser/renderer_host/input/web_input_event_util.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 result.y = window_y; | 130 result.y = window_y; |
131 result.windowX = window_x; | 131 result.windowX = window_x; |
132 result.windowY = window_y; | 132 result.windowY = window_y; |
133 result.timeStampSeconds = time_sec; | 133 result.timeStampSeconds = time_sec; |
134 result.clickCount = click_count; | 134 result.clickCount = click_count; |
135 result.modifiers = modifiers; | 135 result.modifiers = modifiers; |
136 | 136 |
137 if (type == WebInputEvent::MouseDown || type == WebInputEvent::MouseUp) | 137 if (type == WebInputEvent::MouseDown || type == WebInputEvent::MouseUp) |
138 result.button = button; | 138 result.button = button; |
139 else | 139 else |
140 result.button = WebMouseEvent::ButtonNone; | 140 result.button = WebMouseEvent::Button::NoButton; |
141 | 141 |
142 return result; | 142 return result; |
143 } | 143 } |
144 | 144 |
145 WebMouseWheelEvent WebMouseWheelEventBuilder::Build(float ticks_x, | 145 WebMouseWheelEvent WebMouseWheelEventBuilder::Build(float ticks_x, |
146 float ticks_y, | 146 float ticks_y, |
147 float tick_multiplier, | 147 float tick_multiplier, |
148 double time_sec, | 148 double time_sec, |
149 int window_x, | 149 int window_x, |
150 int window_y) { | 150 int window_y) { |
151 WebMouseWheelEvent result; | 151 WebMouseWheelEvent result; |
152 | 152 |
153 result.type = WebInputEvent::MouseWheel; | 153 result.type = WebInputEvent::MouseWheel; |
154 result.x = window_x; | 154 result.x = window_x; |
155 result.y = window_y; | 155 result.y = window_y; |
156 result.windowX = window_x; | 156 result.windowX = window_x; |
157 result.windowY = window_y; | 157 result.windowY = window_y; |
158 result.timeStampSeconds = time_sec; | 158 result.timeStampSeconds = time_sec; |
159 result.button = WebMouseEvent::ButtonNone; | 159 result.button = WebMouseEvent::Button::NoButton; |
160 result.hasPreciseScrollingDeltas = true; | 160 result.hasPreciseScrollingDeltas = true; |
161 result.deltaX = ticks_x * tick_multiplier; | 161 result.deltaX = ticks_x * tick_multiplier; |
162 result.deltaY = ticks_y * tick_multiplier; | 162 result.deltaY = ticks_y * tick_multiplier; |
163 result.wheelTicksX = ticks_x; | 163 result.wheelTicksX = ticks_x; |
164 result.wheelTicksY = ticks_y; | 164 result.wheelTicksY = ticks_y; |
165 | 165 |
166 return result; | 166 return result; |
167 } | 167 } |
168 | 168 |
169 WebGestureEvent WebGestureEventBuilder::Build(WebInputEvent::Type type, | 169 WebGestureEvent WebGestureEventBuilder::Build(WebInputEvent::Type type, |
170 double time_sec, | 170 double time_sec, |
171 int x, | 171 int x, |
172 int y) { | 172 int y) { |
173 DCHECK(WebInputEvent::isGestureEventType(type)); | 173 DCHECK(WebInputEvent::isGestureEventType(type)); |
174 WebGestureEvent result; | 174 WebGestureEvent result; |
175 | 175 |
176 result.type = type; | 176 result.type = type; |
177 result.x = x; | 177 result.x = x; |
178 result.y = y; | 178 result.y = y; |
179 result.timeStampSeconds = time_sec; | 179 result.timeStampSeconds = time_sec; |
180 result.sourceDevice = blink::WebGestureDeviceTouchscreen; | 180 result.sourceDevice = blink::WebGestureDeviceTouchscreen; |
181 | 181 |
182 return result; | 182 return result; |
183 } | 183 } |
184 | 184 |
185 } // namespace content | 185 } // namespace content |
OLD | NEW |