Index: webkit/glue/chrome_client_impl.cc |
=================================================================== |
--- webkit/glue/chrome_client_impl.cc (revision 30061) |
+++ webkit/glue/chrome_client_impl.cc (working copy) |
@@ -183,6 +183,20 @@ |
} |
} |
+void ChromeClientImpl::focusedNodeChanged(WebCore::Node* node) { |
+ WebURL focus_url; |
+ if (node && node->isLink()) { |
+ // This HitTestResult hack is the easiest way to get a link URL out of a |
+ // WebCore::Node. |
+ WebCore::HitTestResult hit_test(WebCore::IntPoint(0, 0)); |
+ // This cast must be valid because of the isLink() check. |
+ hit_test.setURLElement(reinterpret_cast<WebCore::Element*>(node)); |
+ if (hit_test.isLiveLink()) |
+ focus_url = webkit_glue::KURLToWebURL(hit_test.absoluteLinkURL()); |
+ } |
+ webview_->client()->setKeyboardFocusURL(focus_url); |
+} |
+ |
WebCore::Page* ChromeClientImpl::createWindow( |
WebCore::Frame* frame, const WebCore::FrameLoadRequest& r, |
const WebCore::WindowFeatures& features) { |