| Index: content/browser/frame_host/render_frame_host_impl.cc
|
| diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
| index 80bb605d5ae6ba2c40f13c9a46020f95f856ed1b..884a302506fda493e26710eb6804b31d6f5d72af 100644
|
| --- a/content/browser/frame_host/render_frame_host_impl.cc
|
| +++ b/content/browser/frame_host/render_frame_host_impl.cc
|
| @@ -64,6 +64,7 @@
|
| #include "content/public/common/url_constants.h"
|
| #include "content/public/common/url_utils.h"
|
| #include "ui/accessibility/ax_tree.h"
|
| +#include "ui/accessibility/ax_tree_update.h"
|
| #include "url/gurl.h"
|
|
|
| #if defined(OS_MACOSX)
|
| @@ -381,6 +382,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
|
| OnAccessibilityLocationChanges)
|
| IPC_MESSAGE_HANDLER(AccessibilityHostMsg_FindInPageResult,
|
| OnAccessibilityFindInPageResult)
|
| + IPC_MESSAGE_HANDLER(AccessibilityHostMsg_SnapshotResponse,
|
| + OnAccessibilitySnapshotResponse)
|
| IPC_MESSAGE_HANDLER(FrameHostMsg_ToggleFullscreen, OnToggleFullscreen)
|
| // The following message is synthetic and doesn't come from RenderFrame, but
|
| // from RenderProcessHost.
|
| @@ -1392,6 +1395,19 @@ void RenderFrameHostImpl::OnAccessibilityFindInPageResult(
|
| }
|
| }
|
|
|
| +void RenderFrameHostImpl::OnAccessibilitySnapshotResponse(
|
| + int token,
|
| + const ui::AXTreeUpdate& snapshot) {
|
| + std::map<int, AXTreeSnapshotCallback>::iterator it =
|
| + ax_tree_snapshot_callbacks_.find(token);
|
| + if (it != ax_tree_snapshot_callbacks_.end()) {
|
| + it->second.Run(snapshot);
|
| + ax_tree_snapshot_callbacks_.erase(it);
|
| + } else {
|
| + NOTREACHED() << "Received AX tree snapshot response for unknown request";
|
| + }
|
| +}
|
| +
|
| void RenderFrameHostImpl::OnToggleFullscreen(bool enter_fullscreen) {
|
| if (enter_fullscreen)
|
| delegate_->EnterFullscreenMode(GetLastCommittedURL().GetOrigin());
|
| @@ -1805,6 +1821,14 @@ void RenderFrameHostImpl::SetAccessibilityMode(AccessibilityMode mode) {
|
| Send(new FrameMsg_SetAccessibilityMode(routing_id_, mode));
|
| }
|
|
|
| +void RenderFrameHostImpl::RequestAXTreeSnapshot(
|
| + AXTreeSnapshotCallback callback) {
|
| + static int next_token = 1;
|
| + int token = next_token++;
|
| + Send(new AccessibilityMsg_SnapshotTree(routing_id_, token));
|
| + ax_tree_snapshot_callbacks_.insert(std::make_pair(token, callback));
|
| +}
|
| +
|
| void RenderFrameHostImpl::SetAccessibilityCallbackForTesting(
|
| const base::Callback<void(ui::AXEvent, int)>& callback) {
|
| accessibility_testing_callback_ = callback;
|
|
|