summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/html/HTMLPlugInElement.cpp7
-rw-r--r--WebCore/html/HTMLPlugInElement.h6
-rw-r--r--WebCore/plugins/android/PluginViewAndroid.cpp8
3 files changed, 16 insertions, 5 deletions
diff --git a/WebCore/html/HTMLPlugInElement.cpp b/WebCore/html/HTMLPlugInElement.cpp
index dafa8fb..9319034 100644
--- a/WebCore/html/HTMLPlugInElement.cpp
+++ b/WebCore/html/HTMLPlugInElement.cpp
@@ -177,4 +177,11 @@ void HTMLPlugInElement::updateWidgetCallback(Node* n)
static_cast<HTMLPlugInElement*>(n)->updateWidget();
}
+#if PLATFORM(ANDROID)
+bool HTMLPlugInElement::supportsFocus() const
+{
+ return true;
+}
+#endif
+
}
diff --git a/WebCore/html/HTMLPlugInElement.h b/WebCore/html/HTMLPlugInElement.h
index 9d3dc6d..cf18e27 100644
--- a/WebCore/html/HTMLPlugInElement.h
+++ b/WebCore/html/HTMLPlugInElement.h
@@ -60,6 +60,12 @@ protected:
virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
virtual void parseMappedAttribute(MappedAttribute*);
+#if PLATFORM(ANDROID)
+ // in Android, plugin has a focused mode where it accepts all the touch events.
+ // so need to claim that plugin element supports focus instead of using the default.
+ virtual bool supportsFocus() const;
+#endif
+
private:
virtual void defaultEventHandler(Event*);
diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp
index ee39687..682268a 100644
--- a/WebCore/plugins/android/PluginViewAndroid.cpp
+++ b/WebCore/plugins/android/PluginViewAndroid.cpp
@@ -247,11 +247,9 @@ void PluginView::handleMouseEvent(MouseEvent* event)
evt.data.mouse.y = localPos.y();
if (isDown) {
- // The plugin needs focus to receive keyboard events
- if (Page* page = m_parentFrame->page()) {
- page->focusController()->setFocusedNode(m_element, m_parentFrame);
- event->setDefaultHandled();
- }
+ // The plugin needs focus to receive keyboard and touch events
+ m_element->focus();
+ event->setDefaultHandled();
}
}
else {