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

Unified Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 268543008: Cross-process iframe accessibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 6 years, 3 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/renderer/accessibility/blink_ax_tree_source.cc
diff --git a/content/renderer/accessibility/blink_ax_tree_source.cc b/content/renderer/accessibility/blink_ax_tree_source.cc
index a60b4df7b6156119d6611d7ed4cd1be64c60c130..068f03a213e8e2858d9e008812a3d0d40a198c0c 100644
--- a/content/renderer/accessibility/blink_ax_tree_source.cc
+++ b/content/renderer/accessibility/blink_ax_tree_source.cc
@@ -11,6 +11,7 @@
#include "base/strings/utf_string_conversions.h"
#include "content/renderer/accessibility/blink_ax_enum_conversion.h"
#include "content/renderer/render_frame_impl.h"
+#include "content/renderer/render_frame_proxy.h"
#include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/platform/WebSize.h"
@@ -22,6 +23,8 @@
#include "third_party/WebKit/public/web/WebDocumentType.h"
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFormControlElement.h"
+#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebInputElement.h"
#include "third_party/WebKit/public/web/WebNode.h"
#include "third_party/WebKit/public/web/WebView.h"
@@ -32,7 +35,7 @@ using blink::WebAXObject;
using blink::WebDocument;
using blink::WebDocumentType;
using blink::WebElement;
-using blink::WebFrame;
+using blink::WebLocalFrame;
using blink::WebNode;
using blink::WebVector;
using blink::WebView;
@@ -110,6 +113,11 @@ bool BlinkAXTreeSource::IsInTree(blink::WebAXObject node) const {
return false;
}
+void BlinkAXTreeSource::CollectChildFrameIdMapping(
+ std::map<int32, int>* node_to_frame_routing_id_map) {
+ node_to_frame_routing_id_map_ = node_to_frame_routing_id_map;
+}
+
blink::WebAXObject BlinkAXTreeSource::GetRoot() const {
return GetMainDocument().accessibilityObject();
}
@@ -448,6 +456,22 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src,
const gfx::Size& max_offset = document.maximumScrollOffset();
dst->AddIntAttribute(ui::AX_ATTR_SCROLL_X_MAX, max_offset.width());
dst->AddIntAttribute(ui::AX_ATTR_SCROLL_Y_MAX, max_offset.height());
+
+ if (node_to_frame_routing_id_map_ && !src.equals(GetRoot())) {
+ WebLocalFrame* frame = document.frame();
+ RenderFrameImpl* render_frame = RenderFrameImpl::FromWebFrame(frame);
+ if (render_frame) {
+ node_to_frame_routing_id_map_->insert(std::pair<int32, int>(
+ dst->id, render_frame->GetRoutingID()));
+ } else {
+ RenderFrameProxy* render_frame_proxy =
+ RenderFrameProxy::FromWebFrame(frame);
+ if (render_frame_proxy) {
+ node_to_frame_routing_id_map_->insert(std::pair<int32, int>(
+ dst->id, render_frame_proxy->routing_id()));
+ }
+ }
+ }
}
if (dst->role == ui::AX_ROLE_TABLE) {
@@ -550,11 +574,8 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src,
}
blink::WebDocument BlinkAXTreeSource::GetMainDocument() const {
- WebView* view = render_frame_->render_view()->GetWebView();
- WebFrame* main_frame = view ? view->mainFrame() : NULL;
-
- if (main_frame)
- return main_frame->document();
+ if (render_frame_ && render_frame_->GetWebFrame())
+ return render_frame_->GetWebFrame()->document();
return WebDocument();
}
« no previous file with comments | « content/renderer/accessibility/blink_ax_tree_source.h ('k') | content/renderer/accessibility/renderer_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698