diff options
author | Mike Reed <reed@google.com> | 2009-05-28 15:09:41 -0400 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2009-05-28 15:38:10 -0400 |
commit | 2af78f0088820a0b10e92b3d4e07e2688e8555f1 (patch) | |
tree | d26d5765ca464bce242f523785561cae0cf8db15 /WebKit/android/jni/WebViewCore.cpp | |
parent | be9123233ec803662e74d4333c1aab0bb201bb84 (diff) | |
download | external_webkit-2af78f0088820a0b10e92b3d4e07e2688e8555f1.zip external_webkit-2af78f0088820a0b10e92b3d4e07e2688e8555f1.tar.gz external_webkit-2af78f0088820a0b10e92b3d4e07e2688e8555f1.tar.bz2 |
hack to set focus for plugins
expose pluginview from pluginwidget
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 89013ff..c1df546 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -1273,6 +1273,15 @@ void WebViewCore::setKitFocus(int moveGeneration, int buildGeneration, finalKitFocus(frame, node, x, y); } +static bool nodeIsPlugin(Node* node) { + RenderObject* renderer = node->renderer(); + if (renderer->isWidget()) { + Widget* widget = static_cast<RenderWidget*>(renderer)->widget(); + return widget && widget->isPluginView(); + } + return NULL; +} + // Update mouse position and may change focused node. bool WebViewCore::finalKitFocus(WebCore::Frame* frame, WebCore::Node* node, int x, int y) @@ -1300,6 +1309,11 @@ bool WebViewCore::finalKitFocus(WebCore::Frame* frame, WebCore::Node* node, builder.setLastFocus(node); m_lastFocused = node; m_lastFocusedBounds = node->getRect(); + + // hack to give the plugin focus (for keys). better fix on the way + if (nodeIsPlugin(node)) { + node->document()->setFocusedNode(node); + } return true; } |