| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 // A class to facilitate testing that events are correctly received by plugins. | 450 // A class to facilitate testing that events are correctly received by plugins. |
| 451 class EventTestPlugin : public FakeWebPlugin { | 451 class EventTestPlugin : public FakeWebPlugin { |
| 452 public: | 452 public: |
| 453 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) | 453 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) |
| 454 : FakeWebPlugin(frame, params), | 454 : FakeWebPlugin(frame, params), |
| 455 m_lastEventType(WebInputEvent::Undefined) {} | 455 m_lastEventType(WebInputEvent::Undefined) {} |
| 456 | 456 |
| 457 WebInputEventResult handleInputEvent(const WebInputEvent& event, | 457 WebInputEventResult handleInputEvent(const WebInputEvent& event, |
| 458 WebCursorInfo&) override { | 458 WebCursorInfo&) override { |
| 459 m_lastEventType = event.type; | 459 m_lastEventType = event.type(); |
| 460 if (WebInputEvent::isMouseEventType(event.type) || | 460 if (WebInputEvent::isMouseEventType(event.type()) || |
| 461 event.type == WebInputEvent::MouseWheel) { | 461 event.type() == WebInputEvent::MouseWheel) { |
| 462 const WebMouseEvent& mouseEvent = | 462 const WebMouseEvent& mouseEvent = |
| 463 static_cast<const WebMouseEvent&>(event); | 463 static_cast<const WebMouseEvent&>(event); |
| 464 m_lastMouseEventLocation = IntPoint(mouseEvent.x, mouseEvent.y); | 464 m_lastMouseEventLocation = IntPoint(mouseEvent.x, mouseEvent.y); |
| 465 } | 465 } |
| 466 | 466 |
| 467 return WebInputEventResult::HandledSystem; | 467 return WebInputEventResult::HandledSystem; |
| 468 } | 468 } |
| 469 WebInputEvent::Type getLastInputEventType() { return m_lastEventType; } | 469 WebInputEvent::Type getLastInputEventType() { return m_lastEventType; } |
| 470 | 470 |
| 471 IntPoint getLastMouseEventLocation() { return m_lastMouseEventLocation; } | 471 IntPoint getLastMouseEventLocation() { return m_lastMouseEventLocation; } |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 WebString::fromUTF8("translated-plugin")); | 815 WebString::fromUTF8("translated-plugin")); |
| 816 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); | 816 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); |
| 817 | 817 |
| 818 runPendingTasks(); | 818 runPendingTasks(); |
| 819 EXPECT_TRUE( | 819 EXPECT_TRUE( |
| 820 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers( | 820 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers( |
| 821 EventHandlerRegistry::WheelEventBlocking)); | 821 EventHandlerRegistry::WheelEventBlocking)); |
| 822 } | 822 } |
| 823 | 823 |
| 824 } // namespace blink | 824 } // namespace blink |
| OLD | NEW |