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 "ui/events/android/key_event_utils.h" | 10 #include "ui/events/android/key_event_utils.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // is apparently just how webkit handles it and what it expects. | 105 // is apparently just how webkit handles it and what it expects. |
106 result.unmodifiedText[0] = '\r'; | 106 result.unmodifiedText[0] = '\r'; |
107 } | 107 } |
108 result.text[0] = result.unmodifiedText[0]; | 108 result.text[0] = result.unmodifiedText[0]; |
109 result.isSystemKey = is_system_key; | 109 result.isSystemKey = is_system_key; |
110 | 110 |
111 return result; | 111 return result; |
112 } | 112 } |
113 | 113 |
114 WebMouseEvent WebMouseEventBuilder::Build( | 114 WebMouseEvent WebMouseEventBuilder::Build( |
115 WebInputEvent::Type type, | 115 WebInputEvent::Type type, |
116 WebMouseEvent::Button button, | 116 double time_sec, |
117 double time_sec, | 117 int window_x, |
118 int window_x, | 118 int window_y, |
119 int window_y, | 119 int modifiers, |
120 int modifiers, | 120 int click_count, |
121 int click_count, | 121 int pointer_id, |
122 WebPointerProperties::PointerType pointer_type) { | 122 float pressure, |
| 123 float orientation_rad, |
| 124 float tilt_rad, |
| 125 int changed_button, |
| 126 int tool_type) { |
123 | 127 |
124 DCHECK(WebInputEvent::isMouseEventType(type)); | 128 DCHECK(WebInputEvent::isMouseEventType(type)); |
125 WebMouseEvent result; | 129 WebMouseEvent result; |
126 | 130 |
127 result.type = type; | 131 result.type = type; |
128 result.pointerType = pointer_type; | |
129 result.x = window_x; | 132 result.x = window_x; |
130 result.y = window_y; | 133 result.y = window_y; |
131 result.windowX = window_x; | 134 result.windowX = window_x; |
132 result.windowY = window_y; | 135 result.windowY = window_y; |
133 result.timeStampSeconds = time_sec; | 136 result.timeStampSeconds = time_sec; |
134 result.clickCount = click_count; | 137 result.clickCount = click_count; |
135 result.modifiers = modifiers; | 138 result.modifiers = ui::EventFlagsToWebEventModifiers(modifiers); |
136 | 139 |
137 if (type == WebInputEvent::MouseDown || type == WebInputEvent::MouseUp) | 140 ui::SetWebPointerPropertiesFromMotionEventData( |
138 result.button = button; | 141 result, |
139 else | 142 pointer_id, |
140 result.button = WebMouseEvent::Button::NoButton; | 143 pressure, |
| 144 orientation_rad, |
| 145 tilt_rad, |
| 146 changed_button, |
| 147 tool_type); |
141 | 148 |
142 return result; | 149 return result; |
143 } | 150 } |
144 | 151 |
145 WebMouseWheelEvent WebMouseWheelEventBuilder::Build(float ticks_x, | 152 WebMouseWheelEvent WebMouseWheelEventBuilder::Build(float ticks_x, |
146 float ticks_y, | 153 float ticks_y, |
147 float tick_multiplier, | 154 float tick_multiplier, |
148 double time_sec, | 155 double time_sec, |
149 int window_x, | 156 int window_x, |
150 int window_y) { | 157 int window_y) { |
(...skipping 25 matching lines...) Expand all Loading... |
176 result.type = type; | 183 result.type = type; |
177 result.x = x; | 184 result.x = x; |
178 result.y = y; | 185 result.y = y; |
179 result.timeStampSeconds = time_sec; | 186 result.timeStampSeconds = time_sec; |
180 result.sourceDevice = blink::WebGestureDeviceTouchscreen; | 187 result.sourceDevice = blink::WebGestureDeviceTouchscreen; |
181 | 188 |
182 return result; | 189 return result; |
183 } | 190 } |
184 | 191 |
185 } // namespace content | 192 } // namespace content |
OLD | NEW |