Chromium Code Reviews| 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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 620 | 620 |
| 621 void ChromeClientImpl::layoutUpdated(LocalFrame* frame) const { | 621 void ChromeClientImpl::layoutUpdated(LocalFrame* frame) const { |
| 622 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame)); | 622 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame)); |
| 623 } | 623 } |
| 624 | 624 |
| 625 void ChromeClientImpl::showMouseOverURL(const HitTestResult& result) { | 625 void ChromeClientImpl::showMouseOverURL(const HitTestResult& result) { |
| 626 if (!m_webView->client()) | 626 if (!m_webView->client()) |
| 627 return; | 627 return; |
| 628 | 628 |
| 629 WebURL url; | 629 WebURL url; |
| 630 // Find out if the mouse is over a link, and if so, let our UI know... | 630 |
| 631 if (result.isLiveLink() && !result.absoluteLinkURL().getString().isEmpty()) { | 631 // Ignore URL if hitTest include scrollbar |
|
bokan
2016/11/01 21:09:37
I'add add to this comment " since we might have bo
| |
| 632 url = result.absoluteLinkURL(); | 632 if (!result.scrollbar()) { |
| 633 } else if (result.innerNode() && (isHTMLObjectElement(*result.innerNode()) || | 633 // Find out if the mouse is over a link, and if so, let our UI know... |
| 634 isHTMLEmbedElement(*result.innerNode()))) { | 634 if (result.isLiveLink() && |
| 635 LayoutObject* object = result.innerNode()->layoutObject(); | 635 !result.absoluteLinkURL().getString().isEmpty()) { |
| 636 if (object && object->isLayoutPart()) { | 636 url = result.absoluteLinkURL(); |
| 637 Widget* widget = toLayoutPart(object)->widget(); | 637 } else if (result.innerNode() && |
| 638 if (widget && widget->isPluginContainer()) { | 638 (isHTMLObjectElement(*result.innerNode()) || |
| 639 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget); | 639 isHTMLEmbedElement(*result.innerNode()))) { |
| 640 url = plugin->plugin()->linkAtPosition( | 640 LayoutObject* object = result.innerNode()->layoutObject(); |
| 641 result.roundedPointInInnerNodeFrame()); | 641 if (object && object->isLayoutPart()) { |
| 642 Widget* widget = toLayoutPart(object)->widget(); | |
| 643 if (widget && widget->isPluginContainer()) { | |
| 644 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget); | |
| 645 url = plugin->plugin()->linkAtPosition( | |
| 646 result.roundedPointInInnerNodeFrame()); | |
| 647 } | |
| 642 } | 648 } |
| 643 } | 649 } |
| 644 } | 650 } |
| 645 | 651 |
| 646 m_webView->client()->setMouseOverURL(url); | 652 m_webView->client()->setMouseOverURL(url); |
| 647 } | 653 } |
| 648 | 654 |
| 649 void ChromeClientImpl::setToolTip(LocalFrame& frame, | 655 void ChromeClientImpl::setToolTip(LocalFrame& frame, |
| 650 const String& tooltipText, | 656 const String& tooltipText, |
| 651 TextDirection dir) { | 657 TextDirection dir) { |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1155 if (RuntimeEnabledFeatures::presentationEnabled()) | 1161 if (RuntimeEnabledFeatures::presentationEnabled()) |
| 1156 PresentationController::provideTo(frame, client->presentationClient()); | 1162 PresentationController::provideTo(frame, client->presentationClient()); |
| 1157 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) | 1163 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) |
| 1158 provideAudioOutputDeviceClientTo(frame, | 1164 provideAudioOutputDeviceClientTo(frame, |
| 1159 AudioOutputDeviceClientImpl::create()); | 1165 AudioOutputDeviceClientImpl::create()); |
| 1160 if (RuntimeEnabledFeatures::installedAppEnabled()) | 1166 if (RuntimeEnabledFeatures::installedAppEnabled()) |
| 1161 InstalledAppController::provideTo(frame, client->installedAppClient()); | 1167 InstalledAppController::provideTo(frame, client->installedAppClient()); |
| 1162 } | 1168 } |
| 1163 | 1169 |
| 1164 } // namespace blink | 1170 } // namespace blink |
| OLD | NEW |