| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 WebCanvas* canvas, | 109 WebCanvas* canvas, |
| 110 const WebRect& rect, | 110 const WebRect& rect, |
| 111 LocalFrame& root) { | 111 LocalFrame& root) { |
| 112 paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers); | 112 paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers); |
| 113 } | 113 } |
| 114 | 114 |
| 115 WebInputEventResult PageWidgetDelegate::handleInputEvent( | 115 WebInputEventResult PageWidgetDelegate::handleInputEvent( |
| 116 PageWidgetEventHandler& handler, | 116 PageWidgetEventHandler& handler, |
| 117 const WebInputEvent& event, | 117 const WebInputEvent& event, |
| 118 LocalFrame* root) { | 118 LocalFrame* root) { |
| 119 if (event.modifiers & WebInputEvent::IsTouchAccessibility && | 119 if (event.modifiers() & WebInputEvent::IsTouchAccessibility && |
| 120 WebInputEvent::isMouseEventType(event.type)) { | 120 WebInputEvent::isMouseEventType(event.type())) { |
| 121 PlatformMouseEventBuilder pme(root->view(), | 121 PlatformMouseEventBuilder pme(root->view(), |
| 122 static_cast<const WebMouseEvent&>(event)); | 122 static_cast<const WebMouseEvent&>(event)); |
| 123 | 123 |
| 124 IntPoint docPoint(root->view()->rootFrameToContents(pme.position())); | 124 IntPoint docPoint(root->view()->rootFrameToContents(pme.position())); |
| 125 HitTestResult result = root->eventHandler().hitTestResultAtPoint( | 125 HitTestResult result = root->eventHandler().hitTestResultAtPoint( |
| 126 docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); | 126 docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 127 result.setToShadowHostIfInUserAgentShadowRoot(); | 127 result.setToShadowHostIfInUserAgentShadowRoot(); |
| 128 if (result.innerNodeFrame()) { | 128 if (result.innerNodeFrame()) { |
| 129 Document* document = result.innerNodeFrame()->document(); | 129 Document* document = result.innerNodeFrame()->document(); |
| 130 if (document) { | 130 if (document) { |
| 131 AXObjectCache* cache = document->existingAXObjectCache(); | 131 AXObjectCache* cache = document->existingAXObjectCache(); |
| 132 if (cache) | 132 if (cache) |
| 133 cache->onTouchAccessibilityHover( | 133 cache->onTouchAccessibilityHover( |
| 134 result.roundedPointInInnerNodeFrame()); | 134 result.roundedPointInInnerNodeFrame()); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 switch (event.type) { | 139 switch (event.type()) { |
| 140 // FIXME: WebKit seems to always return false on mouse events processing | 140 // FIXME: WebKit seems to always return false on mouse events processing |
| 141 // methods. For now we'll assume it has processed them (as we are only | 141 // methods. For now we'll assume it has processed them (as we are only |
| 142 // interested in whether keyboard events are processed). | 142 // interested in whether keyboard events are processed). |
| 143 // FIXME: Why do we return HandleSuppressed when there is no root or | 143 // FIXME: Why do we return HandleSuppressed when there is no root or |
| 144 // the root is detached? | 144 // the root is detached? |
| 145 case WebInputEvent::MouseMove: | 145 case WebInputEvent::MouseMove: |
| 146 if (!root || !root->view()) | 146 if (!root || !root->view()) |
| 147 return WebInputEventResult::HandledSuppressed; | 147 return WebInputEventResult::HandledSuppressed; |
| 148 handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event), | 148 handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event), |
| 149 std::vector<const WebInputEvent*>()); | 149 std::vector<const WebInputEvent*>()); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 WebInputEventResult PageWidgetEventHandler::handleTouchEvent( | 257 WebInputEventResult PageWidgetEventHandler::handleTouchEvent( |
| 258 LocalFrame& mainFrame, | 258 LocalFrame& mainFrame, |
| 259 const WebTouchEvent& event, | 259 const WebTouchEvent& event, |
| 260 const std::vector<const WebInputEvent*>& coalescedEvents) { | 260 const std::vector<const WebInputEvent*>& coalescedEvents) { |
| 261 return mainFrame.eventHandler().handleTouchEvent( | 261 return mainFrame.eventHandler().handleTouchEvent( |
| 262 PlatformTouchEventBuilder(mainFrame.view(), event), | 262 PlatformTouchEventBuilder(mainFrame.view(), event), |
| 263 createPlatformTouchEventVector(mainFrame.view(), coalescedEvents)); | 263 createPlatformTouchEventVector(mainFrame.view(), coalescedEvents)); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace blink | 266 } // namespace blink |
| OLD | NEW |