OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/accessibility/blink_ax_tree_source.h" | 5 #include "content/renderer/accessibility/blink_ax_tree_source.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 } | 518 } |
519 | 519 |
520 // Browser plugin (used in a <webview>). | 520 // Browser plugin (used in a <webview>). |
521 BrowserPlugin* browser_plugin = BrowserPlugin::GetFromNode(element); | 521 BrowserPlugin* browser_plugin = BrowserPlugin::GetFromNode(element); |
522 if (browser_plugin) { | 522 if (browser_plugin) { |
523 dst->AddContentIntAttribute( | 523 dst->AddContentIntAttribute( |
524 AX_CONTENT_ATTR_CHILD_BROWSER_PLUGIN_INSTANCE_ID, | 524 AX_CONTENT_ATTR_CHILD_BROWSER_PLUGIN_INSTANCE_ID, |
525 browser_plugin->browser_plugin_instance_id()); | 525 browser_plugin->browser_plugin_instance_id()); |
526 } | 526 } |
527 | 527 |
528 // Iframe. | 528 // Frames and iframes. |
529 if (is_iframe) { | 529 WebFrame* frame = WebFrame::fromFrameOwnerElement(element); |
530 WebFrame* frame = WebFrame::fromFrameOwnerElement(element); | 530 if (frame) { |
531 if (frame) { | 531 dst->AddContentIntAttribute( |
532 dst->AddContentIntAttribute( | 532 AX_CONTENT_ATTR_CHILD_ROUTING_ID, |
533 AX_CONTENT_ATTR_CHILD_ROUTING_ID, | 533 GetRoutingIdForFrameOrProxy(frame)); |
534 GetRoutingIdForFrameOrProxy(frame)); | |
535 } | |
536 } | 534 } |
537 } | 535 } |
538 | 536 |
539 if (src.isInLiveRegion()) { | 537 if (src.isInLiveRegion()) { |
540 dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, src.liveRegionAtomic()); | 538 dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, src.liveRegionAtomic()); |
541 dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, src.liveRegionBusy()); | 539 dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, src.liveRegionBusy()); |
542 if (src.liveRegionBusy()) | 540 if (src.liveRegionBusy()) |
543 dst->state |= (1 << ui::AX_STATE_BUSY); | 541 dst->state |= (1 << ui::AX_STATE_BUSY); |
544 if (!src.liveRegionStatus().isEmpty()) { | 542 if (!src.liveRegionStatus().isEmpty()) { |
545 dst->AddStringAttribute( | 543 dst->AddStringAttribute( |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 } | 684 } |
687 } | 685 } |
688 | 686 |
689 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 687 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
690 if (render_frame_ && render_frame_->GetWebFrame()) | 688 if (render_frame_ && render_frame_->GetWebFrame()) |
691 return render_frame_->GetWebFrame()->document(); | 689 return render_frame_->GetWebFrame()->document(); |
692 return WebDocument(); | 690 return WebDocument(); |
693 } | 691 } |
694 | 692 |
695 } // namespace content | 693 } // namespace content |
OLD | NEW |