OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/html_viewer/touch_handler.h" | 5 #include "components/html_viewer/touch_handler.h" |
6 | 6 |
7 #include "third_party/WebKit/public/web/WebInputEvent.h" | 7 #include "third_party/WebKit/public/web/WebInputEvent.h" |
8 #include "third_party/WebKit/public/web/WebView.h" | 8 #include "third_party/WebKit/public/web/WebView.h" |
9 #include "ui/events/base_event_utils.h" | 9 #include "ui/events/base_event_utils.h" |
10 #include "ui/events/blink/blink_event_util.h" | 10 #include "ui/events/blink/blink_event_util.h" |
11 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" | 11 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" |
12 #include "ui/events/gesture_detection/motion_event_generic.h" | 12 #include "ui/events/gesture_detection/motion_event_generic.h" |
13 #include "ui/mojo/events/input_events.mojom.h" | 13 #include "ui/mojo/events/input_events.mojom.h" |
14 | 14 |
15 namespace html_viewer { | 15 namespace html_viewer { |
16 namespace { | 16 namespace { |
17 | 17 |
18 void SetPropertiesFromEvent(const mojo::Event& event, | 18 void SetPropertiesFromEvent(const mojo::Event& event, |
19 ui::PointerProperties* properties) { | 19 ui::PointerProperties* properties) { |
20 properties->id = event.pointer_data->pointer_id; | 20 properties->id = event.pointer_data->pointer_id; |
21 properties->x = event.pointer_data->x; | 21 properties->x = event.pointer_data->x; |
22 properties->y = event.pointer_data->y; | 22 properties->y = event.pointer_data->y; |
23 properties->raw_x = event.pointer_data->screen_x; | 23 properties->raw_x = event.pointer_data->screen_x; |
24 properties->raw_y = event.pointer_data->screen_y; | 24 properties->raw_y = event.pointer_data->screen_y; |
25 properties->pressure = event.pointer_data->pressure; | 25 properties->pressure = event.pointer_data->pressure; |
26 properties->touch_major = event.pointer_data->radius_major; | 26 properties->touch_major = event.pointer_data->radius_major; |
27 properties->touch_minor = event.pointer_data->radius_minor; | 27 properties->touch_minor = event.pointer_data->radius_minor; |
28 properties->orientation = event.pointer_data->orientation; | 28 properties->touch_orientation = event.pointer_data->orientation; |
29 // TODO(sky): Add support for tool_type. | 29 // TODO(sky): Add support for tool_type. |
30 } | 30 } |
31 | 31 |
32 } // namespace | 32 } // namespace |
33 | 33 |
34 TouchHandler::TouchHandler(blink::WebView* web_view) | 34 TouchHandler::TouchHandler(blink::WebView* web_view) |
35 : web_view_(web_view), | 35 : web_view_(web_view), |
36 gesture_provider_(ui::GetGestureProviderConfig( | 36 gesture_provider_(ui::GetGestureProviderConfig( |
37 ui::GestureProviderConfigType::CURRENT_PLATFORM), | 37 ui::GestureProviderConfigType::CURRENT_PLATFORM), |
38 this) { | 38 this) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 case mojo::EVENT_TYPE_POINTER_CANCEL: | 180 case mojo::EVENT_TYPE_POINTER_CANCEL: |
181 current_motion_event_.reset(); | 181 current_motion_event_.reset(); |
182 break; | 182 break; |
183 | 183 |
184 default: | 184 default: |
185 break; | 185 break; |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 } // namespace html_viewer | 189 } // namespace html_viewer |
OLD | NEW |