| Index: sky/viewer/converters/input_event_types.cc
|
| diff --git a/sky/viewer/converters/input_event_types.cc b/sky/viewer/converters/input_event_types.cc
|
| index 10ee2614d6edacd7ef9386f7d08cb581d5d73282..6c8892ba7e98c5e9c33963dd1cceda15ffdafe60 100644
|
| --- a/sky/viewer/converters/input_event_types.cc
|
| +++ b/sky/viewer/converters/input_event_types.cc
|
| @@ -165,14 +165,6 @@ scoped_ptr<blink::WebInputEvent> BuildWebGestureEvent(
|
| web_event->x = event->location_data->in_view_location->x / device_pixel_ratio;
|
| web_event->y = event->location_data->in_view_location->y / device_pixel_ratio;
|
|
|
| - // TODO(erg): Remove this null check as parallel to above.
|
| - if (!event->location_data->screen_location.is_null()) {
|
| - web_event->globalX =
|
| - event->location_data->screen_location->x / device_pixel_ratio;
|
| - web_event->globalY =
|
| - event->location_data->screen_location->y / device_pixel_ratio;
|
| - }
|
| -
|
| return web_event.Pass();
|
| }
|
|
|
| @@ -204,6 +196,26 @@ scoped_ptr<blink::WebInputEvent> BuildWebKeyboardEvent(
|
| return web_event.Pass();
|
| }
|
|
|
| +scoped_ptr<blink::WebInputEvent> BuildWebWheelEvent(
|
| + const mojo::EventPtr& event, float device_pixel_ratio) {
|
| + scoped_ptr<blink::WebWheelEvent> web_event(new blink::WebWheelEvent);
|
| +
|
| + web_event->modifiers = EventFlagsToWebInputEventModifiers(event->flags);
|
| + web_event->timeStampMS =
|
| + base::TimeDelta::FromInternalValue(event->time_stamp).InMillisecondsF();
|
| +
|
| + web_event->type = blink::WebInputEvent::WheelEvent;
|
| +
|
| + const auto& location = event->location_data->in_view_location;
|
| + web_event->x = location->x / device_pixel_ratio;
|
| + web_event->y = location->y / device_pixel_ratio;
|
| +
|
| + web_event->offsetX = event->wheel_data->x_offset / device_pixel_ratio;
|
| + web_event->offsetY = event->wheel_data->y_offset / device_pixel_ratio;
|
| +
|
| + return web_event.Pass();
|
| +}
|
| +
|
| } // namespace
|
|
|
| scoped_ptr<blink::WebInputEvent> ConvertEvent(const mojo::EventPtr& event,
|
| @@ -242,6 +254,9 @@ scoped_ptr<blink::WebInputEvent> ConvertEvent(const mojo::EventPtr& event,
|
| event->action == mojo::EVENT_TYPE_KEY_RELEASED) &&
|
| event->key_data) {
|
| return BuildWebKeyboardEvent(event, device_pixel_ratio);
|
| + } else if (event->action == mojo::EVENT_TYPE_MOUSEWHEEL &&
|
| + event->wheel_data) {
|
| + return BuildWebWheelEvent(event, device_pixel_ratio);
|
| }
|
|
|
| return scoped_ptr<blink::WebInputEvent>();
|
|
|