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

Unified Diff: chrome/browser/ui/ash/accessibility/ax_tree_source_ash.cc

Issue 667713006: Implement automatic load of composed/embedded automation trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 years, 2 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: chrome/browser/ui/ash/accessibility/ax_tree_source_ash.cc
diff --git a/chrome/browser/ui/ash/accessibility/ax_tree_source_ash.cc b/chrome/browser/ui/ash/accessibility/ax_tree_source_ash.cc
index 6bc75025c087d569cccc2e1fbcd4558e510f9e37..73321ee8ed2897b69c4e8bb4863480409e1547fb 100644
--- a/chrome/browser/ui/ash/accessibility/ax_tree_source_ash.cc
+++ b/chrome/browser/ui/ash/accessibility/ax_tree_source_ash.cc
@@ -6,8 +6,13 @@
#include <vector>
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents.h"
#include "ui/views/accessibility/ax_aura_obj_cache.h"
#include "ui/views/accessibility/ax_aura_obj_wrapper.h"
+#include "ui/views/accessibility/ax_view_obj_wrapper.h"
+#include "ui/views/controls/webview/webview.h"
using views::AXAuraObjCache;
using views::AXAuraObjWrapper;
@@ -90,6 +95,22 @@ AXAuraObjWrapper* AXTreeSourceAsh::GetNull() const {
void AXTreeSourceAsh::SerializeNode(
AXAuraObjWrapper* node, ui::AXNodeData* out_data) const {
node->Serialize(out_data);
+
+ if (out_data->role == ui::AX_ROLE_GROUP) {
+ views::View* view = static_cast<views::AXViewObjWrapper*>(node)->view();
+ if (view->GetClassName() == views::WebView::kViewClassName) {
+ out_data->role = ui::AX_ROLE_WEB_AREA;
+ content::WebContents* contents =
+ static_cast<views::WebView*>(view)->GetWebContents();
+ content::RenderFrameHost* rfh = contents->GetMainFrame();
+ if (rfh) {
+ int process_id = rfh->GetProcess()->GetID();
+ int routing_id = rfh->GetRoutingID();
+ out_data->AddIntAttribute(ui::AX_ATTR_FRAME_ID, process_id);
aboxhall 2014/10/29 19:29:11 I'm confused as to why these two attributes are so
+ out_data->AddIntAttribute(ui::AX_ATTR_CHILD_FRAME_ID, routing_id);
+ }
+ }
+ }
}
std::string AXTreeSourceAsh::ToString(

Powered by Google App Engine
This is Rietveld 408576698