| 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) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 538 |
| 539 bool ChromeClientImpl::tabsToLinks() { | 539 bool ChromeClientImpl::tabsToLinks() { |
| 540 return m_webView->tabsToLinks(); | 540 return m_webView->tabsToLinks(); |
| 541 } | 541 } |
| 542 | 542 |
| 543 void ChromeClientImpl::invalidateRect(const IntRect& updateRect) { | 543 void ChromeClientImpl::invalidateRect(const IntRect& updateRect) { |
| 544 if (!updateRect.isEmpty()) | 544 if (!updateRect.isEmpty()) |
| 545 m_webView->invalidateRect(updateRect); | 545 m_webView->invalidateRect(updateRect); |
| 546 } | 546 } |
| 547 | 547 |
| 548 void ChromeClientImpl::scheduleAnimation(Widget* widget) { | 548 void ChromeClientImpl::scheduleAnimation(FrameViewBase* frameViewBase) { |
| 549 DCHECK(widget->isFrameView()); | 549 DCHECK(frameViewBase->isFrameView()); |
| 550 FrameView* view = toFrameView(widget); | 550 FrameView* view = toFrameView(frameViewBase); |
| 551 LocalFrame* frame = view->frame().localFrameRoot(); | 551 LocalFrame* frame = view->frame().localFrameRoot(); |
| 552 | 552 |
| 553 // If the frame is still being created, it might not yet have a WebWidget. | 553 // If the frame is still being created, it might not yet have a WebWidget. |
| 554 // FIXME: Is this the right thing to do? Is there a way to avoid having | 554 // FIXME: Is this the right thing to do? Is there a way to avoid having |
| 555 // a local frame root that doesn't have a WebWidget? During initialization | 555 // a local frame root that doesn't have a WebWidget? During initialization |
| 556 // there is no content to draw so this call serves no purpose. | 556 // there is no content to draw so this call serves no purpose. |
| 557 if (WebLocalFrameImpl::fromFrame(frame) && | 557 if (WebLocalFrameImpl::fromFrame(frame) && |
| 558 WebLocalFrameImpl::fromFrame(frame)->frameWidget()) | 558 WebLocalFrameImpl::fromFrame(frame)->frameWidget()) |
| 559 WebLocalFrameImpl::fromFrame(frame)->frameWidget()->scheduleAnimation(); | 559 WebLocalFrameImpl::fromFrame(frame)->frameWidget()->scheduleAnimation(); |
| 560 } | 560 } |
| 561 | 561 |
| 562 IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport, | 562 IntRect ChromeClientImpl::viewportToScreen( |
| 563 const Widget* widget) const { | 563 const IntRect& rectInViewport, |
| 564 const FrameViewBase* frameViewBase) const { |
| 564 WebRect screenRect(rectInViewport); | 565 WebRect screenRect(rectInViewport); |
| 565 | 566 |
| 566 DCHECK(widget->isFrameView()); | 567 DCHECK(frameViewBase->isFrameView()); |
| 567 const FrameView* view = toFrameView(widget); | 568 const FrameView* view = toFrameView(frameViewBase); |
| 568 LocalFrame* frame = view->frame().localFrameRoot(); | 569 LocalFrame* frame = view->frame().localFrameRoot(); |
| 569 | 570 |
| 570 WebWidgetClient* client = | 571 WebWidgetClient* client = |
| 571 WebLocalFrameImpl::fromFrame(frame)->frameWidget()->client(); | 572 WebLocalFrameImpl::fromFrame(frame)->frameWidget()->client(); |
| 572 | 573 |
| 573 if (client) { | 574 if (client) { |
| 574 client->convertViewportToWindow(&screenRect); | 575 client->convertViewportToWindow(&screenRect); |
| 575 WebRect viewRect = client->viewRect(); | 576 WebRect viewRect = client->viewRect(); |
| 576 screenRect.x += viewRect.x; | 577 screenRect.x += viewRect.x; |
| 577 screenRect.y += viewRect.y; | 578 screenRect.y += viewRect.y; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 if (!result.scrollbar()) { | 633 if (!result.scrollbar()) { |
| 633 // Find out if the mouse is over a link, and if so, let our UI know... | 634 // Find out if the mouse is over a link, and if so, let our UI know... |
| 634 if (result.isLiveLink() && | 635 if (result.isLiveLink() && |
| 635 !result.absoluteLinkURL().getString().isEmpty()) { | 636 !result.absoluteLinkURL().getString().isEmpty()) { |
| 636 url = result.absoluteLinkURL(); | 637 url = result.absoluteLinkURL(); |
| 637 } else if (result.innerNode() && | 638 } else if (result.innerNode() && |
| 638 (isHTMLObjectElement(*result.innerNode()) || | 639 (isHTMLObjectElement(*result.innerNode()) || |
| 639 isHTMLEmbedElement(*result.innerNode()))) { | 640 isHTMLEmbedElement(*result.innerNode()))) { |
| 640 LayoutObject* object = result.innerNode()->layoutObject(); | 641 LayoutObject* object = result.innerNode()->layoutObject(); |
| 641 if (object && object->isLayoutPart()) { | 642 if (object && object->isLayoutPart()) { |
| 642 Widget* widget = toLayoutPart(object)->widget(); | 643 FrameViewBase* frameViewBase = toLayoutPart(object)->widget(); |
| 643 if (widget && widget->isPluginContainer()) { | 644 if (frameViewBase && frameViewBase->isPluginContainer()) { |
| 644 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget); | 645 WebPluginContainerImpl* plugin = |
| 646 toWebPluginContainerImpl(frameViewBase); |
| 645 url = plugin->plugin()->linkAtPosition( | 647 url = plugin->plugin()->linkAtPosition( |
| 646 result.roundedPointInInnerNodeFrame()); | 648 result.roundedPointInInnerNodeFrame()); |
| 647 } | 649 } |
| 648 } | 650 } |
| 649 } | 651 } |
| 650 } | 652 } |
| 651 | 653 |
| 652 m_webView->client()->setMouseOverURL(url); | 654 m_webView->client()->setMouseOverURL(url); |
| 653 } | 655 } |
| 654 | 656 |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 PresentationController::provideTo(frame, client->presentationClient()); | 1221 PresentationController::provideTo(frame, client->presentationClient()); |
| 1220 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) { | 1222 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) { |
| 1221 provideAudioOutputDeviceClientTo(frame, | 1223 provideAudioOutputDeviceClientTo(frame, |
| 1222 new AudioOutputDeviceClientImpl(frame)); | 1224 new AudioOutputDeviceClientImpl(frame)); |
| 1223 } | 1225 } |
| 1224 if (RuntimeEnabledFeatures::installedAppEnabled()) | 1226 if (RuntimeEnabledFeatures::installedAppEnabled()) |
| 1225 InstalledAppController::provideTo(frame, client->relatedAppsFetcher()); | 1227 InstalledAppController::provideTo(frame, client->relatedAppsFetcher()); |
| 1226 } | 1228 } |
| 1227 | 1229 |
| 1228 } // namespace blink | 1230 } // namespace blink |
| OLD | NEW |