| 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 29 matching lines...) Expand all Loading... |
| 40 #include "platform/graphics/GraphicsContext.h" | 40 #include "platform/graphics/GraphicsContext.h" |
| 41 #include "platform/graphics/paint/CullRect.h" | 41 #include "platform/graphics/paint/CullRect.h" |
| 42 #include "platform/graphics/paint/ForeignLayerDisplayItem.h" | 42 #include "platform/graphics/paint/ForeignLayerDisplayItem.h" |
| 43 #include "platform/graphics/paint/PaintController.h" | 43 #include "platform/graphics/paint/PaintController.h" |
| 44 #include "platform/graphics/paint/PaintRecorder.h" | 44 #include "platform/graphics/paint/PaintRecorder.h" |
| 45 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" | 45 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" |
| 46 #include "platform/testing/URLTestHelpers.h" | 46 #include "platform/testing/URLTestHelpers.h" |
| 47 #include "platform/testing/UnitTestHelpers.h" | 47 #include "platform/testing/UnitTestHelpers.h" |
| 48 #include "public/platform/Platform.h" | 48 #include "public/platform/Platform.h" |
| 49 #include "public/platform/WebClipboard.h" | 49 #include "public/platform/WebClipboard.h" |
| 50 #include "public/platform/WebCoalescedInputEvent.h" |
| 50 #include "public/platform/WebCompositorSupport.h" | 51 #include "public/platform/WebCompositorSupport.h" |
| 51 #include "public/platform/WebLayer.h" | 52 #include "public/platform/WebLayer.h" |
| 52 #include "public/platform/WebMouseWheelEvent.h" | 53 #include "public/platform/WebMouseWheelEvent.h" |
| 53 #include "public/platform/WebThread.h" | 54 #include "public/platform/WebThread.h" |
| 54 #include "public/platform/WebTouchEvent.h" | 55 #include "public/platform/WebTouchEvent.h" |
| 55 #include "public/platform/WebURLLoaderMockFactory.h" | 56 #include "public/platform/WebURLLoaderMockFactory.h" |
| 56 #include "public/web/WebDocument.h" | 57 #include "public/web/WebDocument.h" |
| 57 #include "public/web/WebElement.h" | 58 #include "public/web/WebElement.h" |
| 58 #include "public/web/WebFrame.h" | 59 #include "public/web/WebFrame.h" |
| 59 #include "public/web/WebFrameClient.h" | 60 #include "public/web/WebFrameClient.h" |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 WebClipboard::Buffer())); | 452 WebClipboard::Buffer())); |
| 452 } | 453 } |
| 453 | 454 |
| 454 // A class to facilitate testing that events are correctly received by plugins. | 455 // A class to facilitate testing that events are correctly received by plugins. |
| 455 class EventTestPlugin : public FakeWebPlugin { | 456 class EventTestPlugin : public FakeWebPlugin { |
| 456 public: | 457 public: |
| 457 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) | 458 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) |
| 458 : FakeWebPlugin(frame, params), | 459 : FakeWebPlugin(frame, params), |
| 459 last_event_type_(WebInputEvent::kUndefined) {} | 460 last_event_type_(WebInputEvent::kUndefined) {} |
| 460 | 461 |
| 461 WebInputEventResult HandleInputEvent(const WebInputEvent& event, | 462 WebInputEventResult HandleInputEvent( |
| 462 WebCursorInfo&) override { | 463 const WebCoalescedInputEvent& coalesced_event, |
| 464 WebCursorInfo&) override { |
| 465 const WebInputEvent& event = coalesced_event.Event(); |
| 463 last_event_type_ = event.GetType(); | 466 last_event_type_ = event.GetType(); |
| 464 if (WebInputEvent::IsMouseEventType(event.GetType()) || | 467 if (WebInputEvent::IsMouseEventType(event.GetType()) || |
| 465 event.GetType() == WebInputEvent::kMouseWheel) { | 468 event.GetType() == WebInputEvent::kMouseWheel) { |
| 466 const WebMouseEvent& mouse_event = | 469 const WebMouseEvent& mouse_event = |
| 467 static_cast<const WebMouseEvent&>(event); | 470 static_cast<const WebMouseEvent&>(event); |
| 468 last_event_location_ = IntPoint(mouse_event.PositionInWidget().x, | 471 last_event_location_ = IntPoint(mouse_event.PositionInWidget().x, |
| 469 mouse_event.PositionInWidget().y); | 472 mouse_event.PositionInWidget().y); |
| 470 } else if (WebInputEvent::IsTouchEventType(event.GetType())) { | 473 } else if (WebInputEvent::IsTouchEventType(event.GetType())) { |
| 471 const WebTouchEvent& touch_event = | 474 const WebTouchEvent& touch_event = |
| 472 static_cast<const WebTouchEvent&>(event); | 475 static_cast<const WebTouchEvent&>(event); |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 web_view->MainFrame()->GetDocument().GetElementById( | 1073 web_view->MainFrame()->GetDocument().GetElementById( |
| 1071 WebString::FromUTF8("translated-plugin")); | 1074 WebString::FromUTF8("translated-plugin")); |
| 1072 plugin_container_one_element.PluginContainer()->SetWantsWheelEvents(true); | 1075 plugin_container_one_element.PluginContainer()->SetWantsWheelEvents(true); |
| 1073 | 1076 |
| 1074 RunPendingTasks(); | 1077 RunPendingTasks(); |
| 1075 EXPECT_TRUE(web_view->GetPage()->GetEventHandlerRegistry().HasEventHandlers( | 1078 EXPECT_TRUE(web_view->GetPage()->GetEventHandlerRegistry().HasEventHandlers( |
| 1076 EventHandlerRegistry::kWheelEventBlocking)); | 1079 EventHandlerRegistry::kWheelEventBlocking)); |
| 1077 } | 1080 } |
| 1078 | 1081 |
| 1079 } // namespace blink | 1082 } // namespace blink |
| OLD | NEW |