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

Unified Diff: webkit/glue/chrome_client_impl.cc

Issue 337032: Show status bubble for links that have keyboard focus.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/chrome_client_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « webkit/glue/chrome_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698