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

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 2262773002: Fix two race conditions in web view accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « content/browser/frame_host/render_frame_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index 93947fdeeb898165dccdcdfaf2d70e7648deadf8..ed9dafb029dd572b18cc6a88673e264d0e75f381 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -21,6 +21,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/renderer/browser_plugin_delegate.h"
#include "content/public/renderer/content_renderer_client.h"
+#include "content/renderer/accessibility/render_accessibility_impl.h"
#include "content/renderer/browser_plugin/browser_plugin_manager.h"
#include "content/renderer/child_frame_compositing_helper.h"
#include "content/renderer/cursor_utils.h"
@@ -28,6 +29,7 @@
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/sad_plugin.h"
#include "third_party/WebKit/public/platform/WebRect.h"
+#include "third_party/WebKit/public/web/WebAXObject.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
@@ -164,6 +166,19 @@ void BrowserPlugin::Attach() {
attach_params));
attached_ = true;
+
+ // Post an update event to the associated accessibility object.
+ auto* render_frame =
+ RenderFrameImpl::FromRoutingID(render_frame_routing_id());
+ if (render_frame && render_frame->render_accessibility() && container()) {
+ blink::WebElement element = container()->element();
+ blink::WebAXObject ax_element = element.accessibilityObject();
+ if (!ax_element.isDetached()) {
+ render_frame->render_accessibility()->HandleAXEvent(
+ ax_element,
+ ui::AX_EVENT_CHILDREN_CHANGED);
+ }
+ }
}
void BrowserPlugin::Detach() {
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698