From 1efe8793da85ee6e25185175047c077adfe8e55c Mon Sep 17 00:00:00 2001 From: dmazzoni Date: Thu, 6 Aug 2015 18:02:15 -0700 Subject: Get rid of FrameAccessibility using AXTreeIDs Depends on: https://codereview.chromium.org/1257093005/ Instead of keeping track of the relationship between frames in FrameAccessibility, create a subclass of AXNodeData that's only allowed to be used within the content module, and once an AX tree is received in the browser process, convert routing IDs to global AXTreeIDs that can be stored AXNodeData. BUG=368298 Review URL: https://codereview.chromium.org/1267663002 Cr-Commit-Position: refs/heads/master@{#342251} --- .../public/browser/ax_event_notification_details.cc | 20 ++++---------------- .../public/browser/ax_event_notification_details.h | 20 ++++---------------- content/public/browser/render_frame_host.h | 6 ++++++ 3 files changed, 14 insertions(+), 32 deletions(-) (limited to 'content/public/browser') diff --git a/content/public/browser/ax_event_notification_details.cc b/content/public/browser/ax_event_notification_details.cc index 8944f57..ead942c 100644 --- a/content/public/browser/ax_event_notification_details.cc +++ b/content/public/browser/ax_event_notification_details.cc @@ -6,22 +6,10 @@ namespace content { -AXEventNotificationDetails::AXEventNotificationDetails( - int node_id_to_clear, - const std::vector& nodes, - ui::AXEvent event_type, - int id, - std::map node_to_browser_plugin_instance_id_map, - int process_id, - int routing_id) - : node_id_to_clear(node_id_to_clear), - nodes(nodes), - event_type(event_type), - id(id), - node_to_browser_plugin_instance_id_map( - node_to_browser_plugin_instance_id_map), - process_id(process_id), - routing_id(routing_id) { +AXEventNotificationDetails::AXEventNotificationDetails() + : event_type(ui::AX_EVENT_NONE), + id(-1), + ax_tree_id(-1) { } AXEventNotificationDetails::~AXEventNotificationDetails() {} diff --git a/content/public/browser/ax_event_notification_details.h b/content/public/browser/ax_event_notification_details.h index 4173b82..d4ee1d0 100644 --- a/content/public/browser/ax_event_notification_details.h +++ b/content/public/browser/ax_event_notification_details.h @@ -8,8 +8,7 @@ #include #include "content/common/content_export.h" -#include "ui/accessibility/ax_enums.h" -#include "ui/accessibility/ax_node_data.h" +#include "ui/accessibility/ax_tree_update.h" namespace content { @@ -17,24 +16,13 @@ namespace content { // |WebContentsObserver::AccessibilityEventReceived| method. struct CONTENT_EXPORT AXEventNotificationDetails { public: - AXEventNotificationDetails( - int node_id_to_clear, - const std::vector& nodes, - ui::AXEvent event_type, - int id, - std::map node_to_browser_plugin_instance_id_map, - int process_id, - int routing_id); - + AXEventNotificationDetails(); ~AXEventNotificationDetails(); - int node_id_to_clear; - std::vector nodes; + ui::AXTreeUpdate update; ui::AXEvent event_type; int id; - std::map node_to_browser_plugin_instance_id_map; - int process_id; - int routing_id; + int ax_tree_id; }; } // namespace content diff --git a/content/public/browser/render_frame_host.h b/content/public/browser/render_frame_host.h index e47441d..0424979 100644 --- a/content/public/browser/render_frame_host.h +++ b/content/public/browser/render_frame_host.h @@ -40,11 +40,17 @@ class CONTENT_EXPORT RenderFrameHost : public IPC::Listener, // configurations. static void AllowInjectingJavaScriptForAndroidWebView(); + // Returns a RenderFrameHost given its accessibility tree ID. + static RenderFrameHost* FromAXTreeID(int ax_tree_id); + ~RenderFrameHost() override {} // Returns the route id for this frame. virtual int GetRoutingID() = 0; + // Returns the accessibility tree ID for this RenderFrameHost. + virtual int GetAXTreeID() = 0; + // Returns the SiteInstance grouping all RenderFrameHosts that have script // access to this RenderFrameHost, and must therefore live in the same // process. -- cgit v1.1