| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui_events_helper.h" | 5 #include "content/browser/renderer_host/ui_events_helper.h" |
| 6 | 6 |
| 7 #include "content/common/input/web_touch_event_traits.h" |
| 7 #include "third_party/WebKit/public/web/WebInputEvent.h" | 8 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 8 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 9 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 int WebModifiersToUIFlags(int modifiers) { | 14 int WebModifiersToUIFlags(int modifiers) { |
| 14 int flags = ui::EF_NONE; | 15 int flags = ui::EF_NONE; |
| 15 | 16 |
| 16 if (modifiers & blink::WebInputEvent::ShiftKey) | 17 if (modifiers & blink::WebInputEvent::ShiftKey) |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 point->screenPosition.y = root_point.y(); | 319 point->screenPosition.y = root_point.y(); |
| 319 | 320 |
| 320 // Mark the rest of the points as stationary. | 321 // Mark the rest of the points as stationary. |
| 321 for (unsigned i = 0; i < web_event->touchesLength; ++i) { | 322 for (unsigned i = 0; i < web_event->touchesLength; ++i) { |
| 322 blink::WebTouchPoint* iter = web_event->touches + i; | 323 blink::WebTouchPoint* iter = web_event->touches + i; |
| 323 if (iter != point) | 324 if (iter != point) |
| 324 iter->state = blink::WebTouchPoint::StateStationary; | 325 iter->state = blink::WebTouchPoint::StateStationary; |
| 325 } | 326 } |
| 326 | 327 |
| 327 // Update the type of the touch event. | 328 // Update the type of the touch event. |
| 328 web_event->type = TouchEventTypeFromEvent(event); | 329 WebTouchEventTraits::ResetType(web_event, |
| 329 web_event->timeStampSeconds = event.time_stamp().InSecondsF(); | 330 TouchEventTypeFromEvent(event), |
| 331 event.time_stamp().InSecondsF(), |
| 332 WebTouchEventTraits::IGNORE_TOUCHES_STATE); |
| 330 web_event->modifiers = EventFlagsToWebEventModifiers(event.flags()); | 333 web_event->modifiers = EventFlagsToWebEventModifiers(event.flags()); |
| 331 | 334 |
| 332 return point; | 335 return point; |
| 333 } | 336 } |
| 334 | 337 |
| 335 } // namespace content | 338 } // namespace content |
| OLD | NEW |