| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 return web_mouse_button_to_platform_modifier[static_cast<int>(button)]; | 128 return web_mouse_button_to_platform_modifier[static_cast<int>(button)]; |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace | 131 } // namespace |
| 132 | 132 |
| 133 WebMouseEvent TransformWebMouseEvent(FrameView* frame_view, | 133 WebMouseEvent TransformWebMouseEvent(FrameView* frame_view, |
| 134 const WebMouseEvent& event) { | 134 const WebMouseEvent& event) { |
| 135 WebMouseEvent result = event; | 135 WebMouseEvent result = event; |
| 136 | 136 |
| 137 // TODO(dtapuska): Remove this translation. In the past blink has | |
| 138 // converted leaves into moves and not known about leaves. It should | |
| 139 // be educated about them. crbug.com/686196 | |
| 140 if (event.GetType() == WebInputEvent::kMouseEnter || | |
| 141 event.GetType() == WebInputEvent::kMouseLeave) { | |
| 142 result.SetType(WebInputEvent::kMouseMove); | |
| 143 } | |
| 144 | |
| 145 // TODO(dtapuska): Perhaps the event should be constructed correctly? | 137 // TODO(dtapuska): Perhaps the event should be constructed correctly? |
| 146 // crbug.com/686200 | 138 // crbug.com/686200 |
| 147 if (event.GetType() == WebInputEvent::kMouseUp) { | 139 if (event.GetType() == WebInputEvent::kMouseUp) { |
| 148 result.SetModifiers(event.GetModifiers() & | 140 result.SetModifiers(event.GetModifiers() & |
| 149 ~ToWebInputEventModifierFrom(event.button)); | 141 ~ToWebInputEventModifierFrom(event.button)); |
| 150 } | 142 } |
| 151 result.SetFrameScale(FrameScale(frame_view)); | 143 result.SetFrameScale(FrameScale(frame_view)); |
| 152 result.SetFrameTranslate(FrameTranslation(frame_view)); | 144 result.SetFrameTranslate(FrameTranslation(frame_view)); |
| 153 return result; | 145 return result; |
| 154 } | 146 } |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 Vector<WebTouchEvent> result; | 372 Vector<WebTouchEvent> result; |
| 381 for (const auto& event : coalesced_events) { | 373 for (const auto& event : coalesced_events) { |
| 382 DCHECK(WebInputEvent::IsTouchEventType(event->GetType())); | 374 DCHECK(WebInputEvent::IsTouchEventType(event->GetType())); |
| 383 result.push_back(TransformWebTouchEvent( | 375 result.push_back(TransformWebTouchEvent( |
| 384 scale, translation, static_cast<const WebTouchEvent&>(*event))); | 376 scale, translation, static_cast<const WebTouchEvent&>(*event))); |
| 385 } | 377 } |
| 386 return result; | 378 return result; |
| 387 } | 379 } |
| 388 | 380 |
| 389 } // namespace blink | 381 } // namespace blink |
| OLD | NEW |