| 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 WebInputEventResult WebPagePopupImpl::handleCharEvent( | 465 WebInputEventResult WebPagePopupImpl::handleCharEvent( |
| 466 const WebKeyboardEvent& event) { | 466 const WebKeyboardEvent& event) { |
| 467 return handleKeyEvent(event); | 467 return handleKeyEvent(event); |
| 468 } | 468 } |
| 469 | 469 |
| 470 WebInputEventResult WebPagePopupImpl::handleGestureEvent( | 470 WebInputEventResult WebPagePopupImpl::handleGestureEvent( |
| 471 const WebGestureEvent& event) { | 471 const WebGestureEvent& event) { |
| 472 if (m_closing || !m_page || !m_page->mainFrame() || | 472 if (m_closing || !m_page || !m_page->mainFrame() || |
| 473 !toLocalFrame(m_page->mainFrame())->view()) | 473 !toLocalFrame(m_page->mainFrame())->view()) |
| 474 return WebInputEventResult::NotHandled; | 474 return WebInputEventResult::NotHandled; |
| 475 if ((event.type == WebInputEvent::GestureTap || | 475 if ((event.type() == WebInputEvent::GestureTap || |
| 476 event.type == WebInputEvent::GestureTapDown) && | 476 event.type() == WebInputEvent::GestureTapDown) && |
| 477 !isViewportPointInWindow(event.x, event.y)) { | 477 !isViewportPointInWindow(event.x, event.y)) { |
| 478 cancel(); | 478 cancel(); |
| 479 return WebInputEventResult::NotHandled; | 479 return WebInputEventResult::NotHandled; |
| 480 } | 480 } |
| 481 LocalFrame& frame = *toLocalFrame(m_page->mainFrame()); | 481 LocalFrame& frame = *toLocalFrame(m_page->mainFrame()); |
| 482 WebGestureEvent scaledEvent = TransformWebGestureEvent(frame.view(), event); | 482 WebGestureEvent scaledEvent = TransformWebGestureEvent(frame.view(), event); |
| 483 return frame.eventHandler().handleGestureEvent(scaledEvent); | 483 return frame.eventHandler().handleGestureEvent(scaledEvent); |
| 484 } | 484 } |
| 485 | 485 |
| 486 void WebPagePopupImpl::handleMouseDown(LocalFrame& mainFrame, | 486 void WebPagePopupImpl::handleMouseDown(LocalFrame& mainFrame, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 // A WebPagePopupImpl instance usually has two references. | 598 // A WebPagePopupImpl instance usually has two references. |
| 599 // - One owned by the instance itself. It represents the visible widget. | 599 // - One owned by the instance itself. It represents the visible widget. |
| 600 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 600 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 601 // WebPagePopupImpl to close. | 601 // WebPagePopupImpl to close. |
| 602 // We need them because the closing operation is asynchronous and the widget | 602 // We need them because the closing operation is asynchronous and the widget |
| 603 // can be closed while the WebViewImpl is unaware of it. | 603 // can be closed while the WebViewImpl is unaware of it. |
| 604 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 604 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 605 } | 605 } |
| 606 | 606 |
| 607 } // namespace blink | 607 } // namespace blink |
| OLD | NEW |