OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 519 |
520 IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height); | 520 IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height); |
521 // hitTestResultAtPoint() takes a padding rectangle. | 521 // hitTestResultAtPoint() takes a padding rectangle. |
522 // FIXME: We'll be off by 1 when the width or height is even. | 522 // FIXME: We'll be off by 1 when the width or height is even. |
523 LayoutPoint center = documentRect.center(); | 523 LayoutPoint center = documentRect.center(); |
524 // Make the rect we're checking (the point surrounded by padding rects) | 524 // Make the rect we're checking (the point surrounded by padding rects) |
525 // contained inside the requested rect. (Note that -1/2 is 0.) | 525 // contained inside the requested rect. (Note that -1/2 is 0.) |
526 LayoutSize padding((documentRect.width() - 1) / 2, | 526 LayoutSize padding((documentRect.width() - 1) / 2, |
527 (documentRect.height() - 1) / 2); | 527 (documentRect.height() - 1) / 2); |
528 HitTestResult result = frame->eventHandler().hitTestResultAtPoint( | 528 HitTestResult result = frame->eventHandler().hitTestResultAtPoint( |
529 center, HitTestRequest::ReadOnly | HitTestRequest::Active | | 529 center, |
530 HitTestRequest::ListBased, | 530 HitTestRequest::ReadOnly | HitTestRequest::Active | |
| 531 HitTestRequest::ListBased, |
531 padding); | 532 padding); |
532 const HitTestResult::NodeSet& nodes = result.listBasedTestResult(); | 533 const HitTestResult::NodeSet& nodes = result.listBasedTestResult(); |
533 if (nodes.size() != 1) | 534 if (nodes.size() != 1) |
534 return false; | 535 return false; |
535 return nodes.first().get() == m_element; | 536 return nodes.first().get() == m_element; |
536 } | 537 } |
537 | 538 |
538 void WebPluginContainerImpl::requestTouchEventType( | 539 void WebPluginContainerImpl::requestTouchEventType( |
539 TouchEventRequestType requestType) { | 540 TouchEventRequestType requestType) { |
540 if (m_touchEventRequestType == requestType || !m_element) | 541 if (m_touchEventRequestType == requestType || !m_element) |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 return; | 782 return; |
782 | 783 |
783 if (webEvent.type() == WebInputEvent::KeyDown) { | 784 if (webEvent.type() == WebInputEvent::KeyDown) { |
784 #if OS(MACOSX) | 785 #if OS(MACOSX) |
785 if ((webEvent.modifiers() & WebInputEvent::InputModifiers) == | 786 if ((webEvent.modifiers() & WebInputEvent::InputModifiers) == |
786 WebInputEvent::MetaKey | 787 WebInputEvent::MetaKey |
787 #else | 788 #else |
788 if ((webEvent.modifiers() & WebInputEvent::InputModifiers) == | 789 if ((webEvent.modifiers() & WebInputEvent::InputModifiers) == |
789 WebInputEvent::ControlKey | 790 WebInputEvent::ControlKey |
790 #endif | 791 #endif |
791 && (webEvent.windowsKeyCode == VKEY_C || | 792 && |
792 webEvent.windowsKeyCode == VKEY_INSERT) | 793 (webEvent.windowsKeyCode == VKEY_C || |
| 794 webEvent.windowsKeyCode == VKEY_INSERT) |
793 // Only copy if there's a selection, so that we only ever do this | 795 // Only copy if there's a selection, so that we only ever do this |
794 // for Pepper plugins that support copying. Windowless NPAPI | 796 // for Pepper plugins that support copying. Windowless NPAPI |
795 // plugins will get the event as before. | 797 // plugins will get the event as before. |
796 && m_webPlugin->hasSelection()) { | 798 && m_webPlugin->hasSelection()) { |
797 copy(); | 799 copy(); |
798 event->setDefaultHandled(); | 800 event->setDefaultHandled(); |
799 return; | 801 return; |
800 } | 802 } |
801 } | 803 } |
802 | 804 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 // frame view. | 987 // frame view. |
986 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); | 988 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); |
987 } | 989 } |
988 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 990 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
989 // Convert to the plugin position. | 991 // Convert to the plugin position. |
990 for (size_t i = 0; i < cutOutRects.size(); i++) | 992 for (size_t i = 0; i < cutOutRects.size(); i++) |
991 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 993 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
992 } | 994 } |
993 | 995 |
994 } // namespace blink | 996 } // namespace blink |
OLD | NEW |