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

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: Fixed and finished test Created 5 years, 9 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 67ee5d52858553fc8608c7bb5691aa1006b2411d..7c1c49a30f0f94bf5af3aff0a184fd70850a8bb0 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -365,6 +365,12 @@ 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.
+ typedef base::Callback<void(const ui::AXTreeUpdate&)>
Charlie Reis 2015/04/02 23:09:06 Style nit: typedefs belong at the top. http://goog
dmazzoni 2015/04/03 22:49:42 Done.
+ AXTreeSnapshotCallback;
+ 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
@@ -507,6 +513,8 @@ class CONTENT_EXPORT RenderFrameHostImpl
const std::vector<AccessibilityHostMsg_LocationChangeParams>& params);
void OnAccessibilityFindInPageResult(
const AccessibilityHostMsg_FindInPageResultParams& params);
+ void OnAccessibilitySnapshotResponse(int token,
+ const ui::AXTreeUpdate& snapshot);
void OnToggleFullscreen(bool enter_fullscreen);
#if defined(OS_MACOSX) || defined(OS_ANDROID)
@@ -677,6 +685,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
// we don't keep trying to reset forever.
int accessibility_reset_count_;
+ // The mapping of pending accessibility tree snapshot calls created by
+ // RequestAXTreeSnapshot and their corresponding callbacks.
Charlie Reis 2015/04/02 23:09:06 Please say what the key is.
dmazzoni 2015/04/03 22:49:42 Reworded. If this wording looks better, I can modi
+ 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.

Powered by Google App Engine
This is Rietveld 408576698