| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 // Take capture on a mouse down on a plugin so we can send it mouse events. | 676 // Take capture on a mouse down on a plugin so we can send it mouse events. |
| 677 // If the hit node is a plugin but a scrollbar is over it don't start mouse | 677 // If the hit node is a plugin but a scrollbar is over it don't start mouse |
| 678 // capture because it will interfere with the scrollbar receiving events. | 678 // capture because it will interfere with the scrollbar receiving events. |
| 679 IntPoint point(event.x, event.y); | 679 IntPoint point(event.x, event.y); |
| 680 if (event.button == WebMouseEvent::ButtonLeft) { | 680 if (event.button == WebMouseEvent::ButtonLeft) { |
| 681 point = m_localRoot->frameView()->windowToContents(point); | 681 point = m_localRoot->frameView()->windowToContents(point); |
| 682 HitTestResult result(m_localRoot->frame()->eventHandler().hitTestResultA
tPoint(point)); | 682 HitTestResult result(m_localRoot->frame()->eventHandler().hitTestResultA
tPoint(point)); |
| 683 result.setToShadowHostIfInClosedShadowRoot(); | 683 result.setToShadowHostIfInClosedShadowRoot(); |
| 684 Node* hitNode = result.innerNonSharedNode(); | 684 Node* hitNode = result.innerNonSharedNode(); |
| 685 | 685 |
| 686 if (!result.scrollbar() && hitNode && hitNode->renderer() && hitNode->re
nderer()->isEmbeddedObject()) { | 686 if (!result.scrollbar() && hitNode && hitNode->layoutObject() && hitNode
->layoutObject()->isEmbeddedObject()) { |
| 687 m_mouseCaptureNode = hitNode; | 687 m_mouseCaptureNode = hitNode; |
| 688 TRACE_EVENT_ASYNC_BEGIN0("input", "capturing mouse", this); | 688 TRACE_EVENT_ASYNC_BEGIN0("input", "capturing mouse", this); |
| 689 } | 689 } |
| 690 } | 690 } |
| 691 | 691 |
| 692 PageWidgetEventHandler::handleMouseDown(mainFrame, event); | 692 PageWidgetEventHandler::handleMouseDown(mainFrame, event); |
| 693 | 693 |
| 694 if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode) | 694 if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode) |
| 695 m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownG
estureToken(); | 695 m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownG
estureToken(); |
| 696 | 696 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 741 |
| 742 RefPtrWillBeRawPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get()); | 742 RefPtrWillBeRawPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get()); |
| 743 | 743 |
| 744 PlatformKeyboardEventBuilder evt(event); | 744 PlatformKeyboardEventBuilder evt(event); |
| 745 | 745 |
| 746 if (frame->eventHandler().keyEvent(evt)) { | 746 if (frame->eventHandler().keyEvent(evt)) { |
| 747 if (WebInputEvent::RawKeyDown == event.type) { | 747 if (WebInputEvent::RawKeyDown == event.type) { |
| 748 // Suppress the next keypress event unless the focused node is a plu
g-in node. | 748 // Suppress the next keypress event unless the focused node is a plu
g-in node. |
| 749 // (Flash needs these keypress events to handle non-US keyboards.) | 749 // (Flash needs these keypress events to handle non-US keyboards.) |
| 750 Element* element = focusedElement(); | 750 Element* element = focusedElement(); |
| 751 if (!element || !element->renderer() || !element->renderer()->isEmbe
ddedObject()) | 751 if (!element || !element->layoutObject() || !element->layoutObject()
->isEmbeddedObject()) |
| 752 m_suppressNextKeypressEvent = true; | 752 m_suppressNextKeypressEvent = true; |
| 753 } | 753 } |
| 754 return true; | 754 return true; |
| 755 } | 755 } |
| 756 | 756 |
| 757 return keyEventDefault(event); | 757 return keyEventDefault(event); |
| 758 } | 758 } |
| 759 | 759 |
| 760 bool WebFrameWidgetImpl::handleCharEvent(const WebKeyboardEvent& event) | 760 bool WebFrameWidgetImpl::handleCharEvent(const WebKeyboardEvent& event) |
| 761 { | 761 { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 // correspond to Page visibility, but is necessary until we properly sort ou
t OOPIF visibility. | 1023 // correspond to Page visibility, but is necessary until we properly sort ou
t OOPIF visibility. |
| 1024 m_page->setVisibilityState(static_cast<PageVisibilityState>(visibilityState)
, isInitialState); | 1024 m_page->setVisibilityState(static_cast<PageVisibilityState>(visibilityState)
, isInitialState); |
| 1025 | 1025 |
| 1026 if (m_layerTreeView) { | 1026 if (m_layerTreeView) { |
| 1027 bool visible = visibilityState == WebPageVisibilityStateVisible; | 1027 bool visible = visibilityState == WebPageVisibilityStateVisible; |
| 1028 m_layerTreeView->setVisible(visible); | 1028 m_layerTreeView->setVisible(visible); |
| 1029 } | 1029 } |
| 1030 } | 1030 } |
| 1031 | 1031 |
| 1032 } // namespace blink | 1032 } // namespace blink |
| OLD | NEW |