Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 2491953004: Reland of Fix link's hover state if the link under scrollbar (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 624
625 void ChromeClientImpl::layoutUpdated(LocalFrame* frame) const { 625 void ChromeClientImpl::layoutUpdated(LocalFrame* frame) const {
626 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame)); 626 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame));
627 } 627 }
628 628
629 void ChromeClientImpl::showMouseOverURL(const HitTestResult& result) { 629 void ChromeClientImpl::showMouseOverURL(const HitTestResult& result) {
630 if (!m_webView->client()) 630 if (!m_webView->client())
631 return; 631 return;
632 632
633 WebURL url; 633 WebURL url;
634 // Find out if the mouse is over a link, and if so, let our UI know... 634
635 if (result.isLiveLink() && !result.absoluteLinkURL().getString().isEmpty()) { 635 // Ignore URL if hitTest include scrollbar since we might have both a
636 url = result.absoluteLinkURL(); 636 // scrollbar and an element in the case of overlay scrollbars.
637 } else if (result.innerNode() && (isHTMLObjectElement(*result.innerNode()) || 637 if (!result.scrollbar()) {
638 isHTMLEmbedElement(*result.innerNode()))) { 638 // Find out if the mouse is over a link, and if so, let our UI know...
639 LayoutObject* object = result.innerNode()->layoutObject(); 639 if (result.isLiveLink() &&
640 if (object && object->isLayoutPart()) { 640 !result.absoluteLinkURL().getString().isEmpty()) {
641 Widget* widget = toLayoutPart(object)->widget(); 641 url = result.absoluteLinkURL();
642 if (widget && widget->isPluginContainer()) { 642 } else if (result.innerNode() &&
643 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget); 643 (isHTMLObjectElement(*result.innerNode()) ||
644 url = plugin->plugin()->linkAtPosition( 644 isHTMLEmbedElement(*result.innerNode()))) {
645 result.roundedPointInInnerNodeFrame()); 645 LayoutObject* object = result.innerNode()->layoutObject();
646 if (object && object->isLayoutPart()) {
647 Widget* widget = toLayoutPart(object)->widget();
648 if (widget && widget->isPluginContainer()) {
649 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget);
650 url = plugin->plugin()->linkAtPosition(
651 result.roundedPointInInnerNodeFrame());
652 }
646 } 653 }
647 } 654 }
648 } 655 }
649 656
650 m_webView->client()->setMouseOverURL(url); 657 m_webView->client()->setMouseOverURL(url);
651 } 658 }
652 659
653 void ChromeClientImpl::setToolTip(LocalFrame& frame, 660 void ChromeClientImpl::setToolTip(LocalFrame& frame,
654 const String& tooltipText, 661 const String& tooltipText,
655 TextDirection dir) { 662 TextDirection dir) {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 if (RuntimeEnabledFeatures::presentationEnabled()) 1166 if (RuntimeEnabledFeatures::presentationEnabled())
1160 PresentationController::provideTo(frame, client->presentationClient()); 1167 PresentationController::provideTo(frame, client->presentationClient());
1161 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) 1168 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
1162 provideAudioOutputDeviceClientTo(frame, 1169 provideAudioOutputDeviceClientTo(frame,
1163 AudioOutputDeviceClientImpl::create()); 1170 AudioOutputDeviceClientImpl::create());
1164 if (RuntimeEnabledFeatures::installedAppEnabled()) 1171 if (RuntimeEnabledFeatures::installedAppEnabled())
1165 InstalledAppController::provideTo(frame, client->installedAppClient()); 1172 InstalledAppController::provideTo(frame, client->installedAppClient());
1166 } 1173 }
1167 1174
1168 } // namespace blink 1175 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/ChromeClient.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698