summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-06-24 05:21:44 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-06-24 05:21:44 -0700
commit5ca2a04f71c6347896367f7c682ff24a23b6c75a (patch)
treef5c53b303a1d651ca67ab275d1d2acfbbd43c6f6 /WebKit/android
parent25879119c8ebef1c84e7e567167ee7594c81c2db (diff)
parent47948bfb8a524bddc90acb80c878878a561b3e88 (diff)
downloadexternal_webkit-5ca2a04f71c6347896367f7c682ff24a23b6c75a.zip
external_webkit-5ca2a04f71c6347896367f7c682ff24a23b6c75a.tar.gz
external_webkit-5ca2a04f71c6347896367f7c682ff24a23b6c75a.tar.bz2
Merge change 5111
* changes: Adding keyEvent support for plugins.
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp46
-rw-r--r--WebKit/android/jni/WebViewCore.h3
2 files changed, 26 insertions, 23 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 07f9fd4..29cfd3a 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1157,6 +1157,29 @@ void WebViewCore::sendPluginEvent(const ANPEvent& evt)
}
}
+static bool nodeIsPlugin(Node* node) {
+ RenderObject* renderer = node->renderer();
+ if (renderer && renderer->isWidget()) {
+ Widget* widget = static_cast<RenderWidget*>(renderer)->widget();
+ return widget && widget->isPluginView();
+ }
+ return false;
+}
+
+Node* WebViewCore::cursorNodeIsPlugin() {
+ gCursorBoundsMutex.lock();
+ bool hasCursorBounds = m_hasCursorBounds;
+ Frame* frame = (Frame*) m_cursorFrame;
+ Node* node = (Node*) m_cursorNode;
+ gCursorBoundsMutex.unlock();
+ if (hasCursorBounds && CacheBuilder::validNode(m_mainFrame, frame, node)
+ && nodeIsPlugin(node)) {
+ return node;
+ }
+ return 0;
+}
+
+
///////////////////////////////////////////////////////////////////////////////
void WebViewCore::moveMouseIfLatest(int moveGeneration,
WebCore::Frame* frame, int x, int y)
@@ -1173,15 +1196,6 @@ void WebViewCore::moveMouseIfLatest(int moveGeneration,
moveMouse(frame, x, y);
}
-static bool nodeIsPlugin(Node* node) {
- RenderObject* renderer = node->renderer();
- if (renderer && renderer->isWidget()) {
- Widget* widget = static_cast<RenderWidget*>(renderer)->widget();
- return widget && widget->isPluginView();
- }
- return 0;
-}
-
// Update mouse position and may change focused node.
void WebViewCore::moveMouse(WebCore::Frame* frame, int x, int y)
{
@@ -1616,20 +1630,6 @@ bool WebViewCore::key(int keyCode, UChar32 unichar, int repeatCount, bool isShif
{
WebCore::EventHandler* eventHandler = m_mainFrame->eventHandler();
WebCore::Node* focusNode = currentFocus();
- if (!focusNode) {
- gCursorBoundsMutex.lock();
- bool hasCursorBounds = m_hasCursorBounds;
- Frame* frame = (Frame*) m_cursorFrame;
- Node* node = (Node*) m_cursorNode;
- gCursorBoundsMutex.unlock();
- if (hasCursorBounds
- && CacheBuilder::validNode(m_mainFrame, frame, node)
- && nodeIsPlugin(node)) {
- // check if this plugin really wants the key (TODO)
- DBG_NAV_LOGD("widget=%p is plugin", widget);
- focusNode = node;
- }
- }
if (focusNode) {
eventHandler = focusNode->document()->frame()->eventHandler();
}
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index e08bbb8..26e3a23 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -294,6 +294,9 @@ namespace android {
// send this event to all of the plugins who have the given flag set
void sendPluginEvent(const ANPEvent& evt, ANPEventFlag flag);
+ // return the cursorNode if it is a plugin
+ Node* cursorNodeIsPlugin();
+
// Notify the Java side whether it needs to pass down the touch events
void needTouchEvents(bool);