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

Unified Diff: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp

Issue 2797943002: Set plugin focus via element dispatch (Closed)
Patch Set: Dispatch to DOM onblur/onfocus first, then call plugin Created 3 years, 8 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
Index: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
index d90cb6f799e9e99214dd862bc71954a047db59f9..895b44d1ffd7e832ef03c0cbbcec185101751649 100644
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
@@ -97,6 +97,24 @@ DEFINE_TRACE(HTMLPlugInElement) {
HTMLFrameOwnerElement::trace(visitor);
}
+void HTMLPlugInElement::dispatchBlurEvent(
+ Element* newFocusedElement,
+ WebFocusType type,
+ InputDeviceCapabilities* sourceCapabilities) {
+ Element::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities);
haraken 2017/04/06 06:20:26 Can we add a comment on why we want to call Elemen
joelhockey 2017/04/06 06:28:39 Done. I hope my explanation is reasonable. Feel
dcheng 2017/04/06 06:28:49 Thinking about this more, either ordering makes me
joelhockey 2017/04/07 06:56:05 You are right that it was possible for plugin to e
+ if (m_plugin)
+ m_plugin->setFocused(false, type);
+}
+
+void HTMLPlugInElement::dispatchFocusEvent(
+ Element* oldFocusedElement,
+ WebFocusType type,
+ InputDeviceCapabilities* sourceCapabilities) {
+ Element::dispatchFocusEvent(oldFocusedElement, type, sourceCapabilities);
+ if (m_plugin)
+ m_plugin->setFocused(true, type);
+}
+
void HTMLPlugInElement::setPlugin(PluginView* plugin) {
if (plugin == m_plugin)
return;
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLPlugInElement.h ('k') | third_party/WebKit/Source/core/plugins/PluginView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698