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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 15741009: Native Android accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 7 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/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 73dd8d9ed6f1568d34b403dae349b59764cb2260..e72fd40b3d0ad0c9838f2908efd3dd71bec3b375 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -1909,18 +1909,32 @@ void RenderViewHostImpl::OnAccessibilityNotifications(
const AccessibilityHostMsg_NotificationParams& param = params[i];
AccessibilityNotification src_type = param.notification_type;
- if ((src_type == AccessibilityNotificationLayoutComplete ||
- src_type == AccessibilityNotificationLoadComplete) &&
- save_accessibility_tree_for_testing_) {
- MakeAccessibilityNodeDataTree(param.nodes, &accessibility_tree_);
+ bool is_about_blank = false;
+ for (unsigned j = 0; j < param.nodes.size(); j++) {
+ std::map<AccessibilityNodeData::StringAttribute, string16>::const_iterator iter;
David Trainor- moved to gerrit 2013/06/04 20:27:18 line too long.
dmazzoni 2013/06/07 20:23:16 Done.
+ iter = param.nodes[j].string_attributes.find(
+ AccessibilityNodeData::ATTR_DOC_URL);
+ if (iter != param.nodes[j].string_attributes.end()) {
+ string16 doc_url = iter->second;
+ if (doc_url == ASCIIToUTF16("about:blank"))
David Trainor- moved to gerrit 2013/06/04 20:27:18 I feel like about:blank a constant somewhere. I d
dmazzoni 2013/06/07 20:23:16 Done.
+ is_about_blank = true;
David Trainor- moved to gerrit 2013/06/04 20:27:18 break here? Could also just put the logic in here
dmazzoni 2013/06/07 20:23:16 We'd need to break out of one for loop and continu
+ }
}
- if (src_type == AccessibilityNotificationLayoutComplete) {
- accessibility_layout_callback_.Run();
- } else if (src_type == AccessibilityNotificationLoadComplete) {
- accessibility_load_callback_.Run();
- } else {
- accessibility_other_callback_.Run();
+ if (!is_about_blank) {
+ if ((src_type == AccessibilityNotificationLayoutComplete ||
+ src_type == AccessibilityNotificationLoadComplete) &&
+ save_accessibility_tree_for_testing_) {
+ MakeAccessibilityNodeDataTree(param.nodes, &accessibility_tree_);
+ }
+
+ if (src_type == AccessibilityNotificationLayoutComplete) {
+ accessibility_layout_callback_.Run();
+ } else if (src_type == AccessibilityNotificationLoadComplete) {
+ accessibility_load_callback_.Run();
+ } else {
+ accessibility_other_callback_.Run();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698