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

Unified Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 1051923003: Add a WebContentsImpl API to snapshot the accessibility tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up callbacks before end of OnRenderProcessGone Created 5 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: content/browser/frame_host/render_frame_host_impl.h
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index 283be24ef7bcbd431ae8bec34dc477a1823255b4..9ac9b8d174fe3f6526c1a990b151c691493335af 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -91,6 +91,9 @@ class CONTENT_EXPORT RenderFrameHostImpl
: public RenderFrameHost,
public BrowserAccessibilityDelegate {
public:
+ typedef base::Callback<void(const ui::AXTreeUpdate&)>
+ AXTreeSnapshotCallback;
+
// Keeps track of the state of the RenderFrameHostImpl, particularly with
// respect to swap out.
enum RenderFrameHostImplState {
@@ -366,6 +369,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
// Send a message to the renderer process to change the accessibility mode.
void SetAccessibilityMode(AccessibilityMode AccessibilityMode);
+ // Request a one-time snapshot of the accessibility tree without changing
+ // the accessibility mode.
+ void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback);
+
// Turn on accessibility testing. The given callback will be run
// every time an accessibility notification is received from the
// renderer process, and the accessibility tree it sent can be
@@ -511,6 +518,8 @@ class CONTENT_EXPORT RenderFrameHostImpl
const std::vector<AccessibilityHostMsg_LocationChangeParams>& params);
void OnAccessibilityFindInPageResult(
const AccessibilityHostMsg_FindInPageResultParams& params);
+ void OnAccessibilitySnapshotResponse(int callback_id,
+ const ui::AXTreeUpdate& snapshot);
void OnToggleFullscreen(bool enter_fullscreen);
#if defined(OS_MACOSX) || defined(OS_ANDROID)
@@ -681,6 +690,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
// we don't keep trying to reset forever.
int accessibility_reset_count_;
+ // The mapping from callback id to corresponding callback for pending
+ // accessibility tree snapshot calls created by RequestAXTreeSnapshot.
+ std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_;
+
// Callback when an event is received, for testing.
base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_;
// The most recently received accessibility tree - for testing only.
« no previous file with comments | « content/browser/accessibility/snapshot_ax_tree_browsertest.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698