| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return TransformWebTouchEvent(FrameScale(frame_view), | 188 return TransformWebTouchEvent(FrameScale(frame_view), |
| 189 FrameTranslation(frame_view), event); | 189 FrameTranslation(frame_view), event); |
| 190 } | 190 } |
| 191 | 191 |
| 192 WebMouseEventBuilder::WebMouseEventBuilder(const FrameView* plugin_parent, | 192 WebMouseEventBuilder::WebMouseEventBuilder(const FrameView* plugin_parent, |
| 193 const LayoutItem layout_item, | 193 const LayoutItem layout_item, |
| 194 const MouseEvent& event) { | 194 const MouseEvent& event) { |
| 195 if (event.NativeEvent()) { | 195 if (event.NativeEvent()) { |
| 196 *static_cast<WebMouseEvent*>(this) = | 196 *static_cast<WebMouseEvent*>(this) = |
| 197 event.NativeEvent()->FlattenTransform(); | 197 event.NativeEvent()->FlattenTransform(); |
| 198 WebFloatPoint absolute_root_frame_location = PositionInRootFrame(); | 198 WebFloatPoint absolute_location = PositionInRootFrame(); |
| 199 IntPoint local_point = RoundedIntPoint(layout_item.AbsoluteToLocal( | 199 |
| 200 absolute_root_frame_location, kUseTransforms)); | 200 // TODO(dtapuska): |plugin_parent| should never be null. Remove this |
| 201 // conditional code. |
| 202 // Translate the root frame position to content coordinates. |
| 203 if (plugin_parent) { |
| 204 absolute_location = plugin_parent->RootFrameToContents(absolute_location); |
| 205 } |
| 206 |
| 207 IntPoint local_point = RoundedIntPoint( |
| 208 layout_item.AbsoluteToLocal(absolute_location, kUseTransforms)); |
| 201 SetPositionInWidget(local_point.X(), local_point.Y()); | 209 SetPositionInWidget(local_point.X(), local_point.Y()); |
| 202 return; | 210 return; |
| 203 } | 211 } |
| 204 | 212 |
| 205 // Code below here can be removed once OOPIF ships. | 213 // Code below here can be removed once OOPIF ships. |
| 206 // OOPIF will prevent synthetic events being dispatched into | 214 // OOPIF will prevent synthetic events being dispatched into |
| 207 // other frames; but for now we allow the fallback to generate | 215 // other frames; but for now we allow the fallback to generate |
| 208 // WebMouseEvents from synthetic events. | 216 // WebMouseEvents from synthetic events. |
| 209 if (event.type() == EventTypeNames::mousemove) | 217 if (event.type() == EventTypeNames::mousemove) |
| 210 type_ = WebInputEvent::kMouseMove; | 218 type_ = WebInputEvent::kMouseMove; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 Vector<WebTouchEvent> result; | 380 Vector<WebTouchEvent> result; |
| 373 for (const auto& event : coalesced_events) { | 381 for (const auto& event : coalesced_events) { |
| 374 DCHECK(WebInputEvent::IsTouchEventType(event->GetType())); | 382 DCHECK(WebInputEvent::IsTouchEventType(event->GetType())); |
| 375 result.push_back(TransformWebTouchEvent( | 383 result.push_back(TransformWebTouchEvent( |
| 376 scale, translation, static_cast<const WebTouchEvent&>(*event))); | 384 scale, translation, static_cast<const WebTouchEvent&>(*event))); |
| 377 } | 385 } |
| 378 return result; | 386 return result; |
| 379 } | 387 } |
| 380 | 388 |
| 381 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |