| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebPluginContainerImpl.h" | 32 #include "WebPluginContainerImpl.h" |
| 33 | 33 |
| 34 #include "ChromeClientImpl.h" |
| 34 #include "WebCursorInfo.h" | 35 #include "WebCursorInfo.h" |
| 35 #include "WebDataSourceImpl.h" | 36 #include "WebDataSourceImpl.h" |
| 36 #include "WebInputEvent.h" | 37 #include "WebInputEvent.h" |
| 37 #include "WebInputEventConversion.h" | 38 #include "WebInputEventConversion.h" |
| 38 #include "WebKit.h" | 39 #include "WebKit.h" |
| 39 #include "WebKitClient.h" | |
| 40 #include "WebPlugin.h" | 40 #include "WebPlugin.h" |
| 41 #include "WebRect.h" | 41 #include "WebRect.h" |
| 42 #include "WebURLError.h" | 42 #include "WebURLError.h" |
| 43 #include "WebURLRequest.h" | 43 #include "WebURLRequest.h" |
| 44 #include "WebVector.h" | 44 #include "WebVector.h" |
| 45 #include "WrappedResourceResponse.h" | 45 #include "WrappedResourceResponse.h" |
| 46 | 46 |
| 47 #include "EventNames.h" | 47 #include "EventNames.h" |
| 48 #include "FocusController.h" | 48 #include "FocusController.h" |
| 49 #include "FormState.h" | 49 #include "FormState.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 // fixes several Mac Chromium bugs, but does indeed prevent windowless plugins | 366 // fixes several Mac Chromium bugs, but does indeed prevent windowless plugins |
| 367 // from getting focus in Windows builds, as pkasting notes above. So for | 367 // from getting focus in Windows builds, as pkasting notes above. So for |
| 368 // now, we only do so in Mac builds. | 368 // now, we only do so in Mac builds. |
| 369 #endif | 369 #endif |
| 370 if (handled) | 370 if (handled) |
| 371 event->setDefaultHandled(); | 371 event->setDefaultHandled(); |
| 372 | 372 |
| 373 // A windowless plugin can change the cursor in response to a mouse move | 373 // A windowless plugin can change the cursor in response to a mouse move |
| 374 // event. We need to reflect the changed cursor in the frame view as the | 374 // event. We need to reflect the changed cursor in the frame view as the |
| 375 // mouse is moved in the boundaries of the windowless plugin. | 375 // mouse is moved in the boundaries of the windowless plugin. |
| 376 webKitClient()->setCursorForPlugin(cursorInfo, parentView->frame()); | 376 Page* page = parentView->frame()->page(); |
| 377 if (!page) |
| 378 return; |
| 379 ChromeClientImpl* chromeClient = |
| 380 static_cast<ChromeClientImpl*>(page->chrome()->client()); |
| 381 chromeClient->setCursorForPlugin(cursorInfo); |
| 377 } | 382 } |
| 378 | 383 |
| 379 void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event) | 384 void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event) |
| 380 { | 385 { |
| 381 WebKeyboardEventBuilder webEvent(*event); | 386 WebKeyboardEventBuilder webEvent(*event); |
| 382 if (webEvent.type == WebInputEvent::Undefined) | 387 if (webEvent.type == WebInputEvent::Undefined) |
| 383 return; | 388 return; |
| 384 | 389 |
| 385 WebCursorInfo cursor_info; | 390 WebCursorInfo cursor_info; |
| 386 bool handled = m_webPlugin->handleInputEvent(webEvent, cursor_info); | 391 bool handled = m_webPlugin->handleInputEvent(webEvent, cursor_info); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 roundedIntPoint(iframeRenderer->localToAbsolute()); | 547 roundedIntPoint(iframeRenderer->localToAbsolute()); |
| 543 RenderBox* rbox = toRenderBox(iframeRenderer); | 548 RenderBox* rbox = toRenderBox(iframeRenderer); |
| 544 IntSize size(rbox->width(), rbox->height()); | 549 IntSize size(rbox->width(), rbox->height()); |
| 545 cutOutRects.append(IntRect(point, size)); | 550 cutOutRects.append(IntRect(point, size)); |
| 546 } | 551 } |
| 547 } | 552 } |
| 548 } | 553 } |
| 549 } | 554 } |
| 550 | 555 |
| 551 } // namespace WebKit | 556 } // namespace WebKit |
| OLD | NEW |