| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 cancel(); | 477 cancel(); |
| 478 return WebInputEventResult::NotHandled; | 478 return WebInputEventResult::NotHandled; |
| 479 } | 479 } |
| 480 LocalFrame& frame = *toLocalFrame(m_page->mainFrame()); | 480 LocalFrame& frame = *toLocalFrame(m_page->mainFrame()); |
| 481 WebGestureEvent scaledEvent = TransformWebGestureEvent(frame.view(), event); | 481 WebGestureEvent scaledEvent = TransformWebGestureEvent(frame.view(), event); |
| 482 return frame.eventHandler().handleGestureEvent(scaledEvent); | 482 return frame.eventHandler().handleGestureEvent(scaledEvent); |
| 483 } | 483 } |
| 484 | 484 |
| 485 void WebPagePopupImpl::handleMouseDown(LocalFrame& mainFrame, | 485 void WebPagePopupImpl::handleMouseDown(LocalFrame& mainFrame, |
| 486 const WebMouseEvent& event) { | 486 const WebMouseEvent& event) { |
| 487 if (isViewportPointInWindow(event.x, event.y)) | 487 if (isViewportPointInWindow(event.positionInWidget().x, |
| 488 event.positionInWidget().y)) |
| 488 PageWidgetEventHandler::handleMouseDown(mainFrame, event); | 489 PageWidgetEventHandler::handleMouseDown(mainFrame, event); |
| 489 else | 490 else |
| 490 cancel(); | 491 cancel(); |
| 491 } | 492 } |
| 492 | 493 |
| 493 WebInputEventResult WebPagePopupImpl::handleMouseWheel( | 494 WebInputEventResult WebPagePopupImpl::handleMouseWheel( |
| 494 LocalFrame& mainFrame, | 495 LocalFrame& mainFrame, |
| 495 const WebMouseWheelEvent& event) { | 496 const WebMouseWheelEvent& event) { |
| 496 if (isViewportPointInWindow(event.x, event.y)) | 497 if (isViewportPointInWindow(event.positionInWidget().x, |
| 498 event.positionInWidget().y)) |
| 497 return PageWidgetEventHandler::handleMouseWheel(mainFrame, event); | 499 return PageWidgetEventHandler::handleMouseWheel(mainFrame, event); |
| 498 cancel(); | 500 cancel(); |
| 499 return WebInputEventResult::NotHandled; | 501 return WebInputEventResult::NotHandled; |
| 500 } | 502 } |
| 501 | 503 |
| 502 bool WebPagePopupImpl::isViewportPointInWindow(int x, int y) { | 504 bool WebPagePopupImpl::isViewportPointInWindow(int x, int y) { |
| 503 WebRect pointInWindow(x, y, 0, 0); | 505 WebRect pointInWindow(x, y, 0, 0); |
| 504 widgetClient()->convertViewportToWindow(&pointInWindow); | 506 widgetClient()->convertViewportToWindow(&pointInWindow); |
| 505 WebRect windowRect = windowRectInScreen(); | 507 WebRect windowRect = windowRectInScreen(); |
| 506 return IntRect(0, 0, windowRect.width, windowRect.height) | 508 return IntRect(0, 0, windowRect.width, windowRect.height) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 // A WebPagePopupImpl instance usually has two references. | 599 // A WebPagePopupImpl instance usually has two references. |
| 598 // - One owned by the instance itself. It represents the visible widget. | 600 // - One owned by the instance itself. It represents the visible widget. |
| 599 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 601 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 600 // WebPagePopupImpl to close. | 602 // WebPagePopupImpl to close. |
| 601 // We need them because the closing operation is asynchronous and the widget | 603 // We need them because the closing operation is asynchronous and the widget |
| 602 // can be closed while the WebViewImpl is unaware of it. | 604 // can be closed while the WebViewImpl is unaware of it. |
| 603 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 605 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 604 } | 606 } |
| 605 | 607 |
| 606 } // namespace blink | 608 } // namespace blink |
| OLD | NEW |