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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 dst->role == ui::AX_ROLE_SCROLL_BAR || | 431 dst->role == ui::AX_ROLE_SCROLL_BAR || |
432 dst->role == ui::AX_ROLE_SLIDER || | 432 dst->role == ui::AX_ROLE_SLIDER || |
433 dst->role == ui::AX_ROLE_SPIN_BUTTON) { | 433 dst->role == ui::AX_ROLE_SPIN_BUTTON) { |
434 dst->AddFloatAttribute(ui::AX_ATTR_VALUE_FOR_RANGE, src.valueForRange()); | 434 dst->AddFloatAttribute(ui::AX_ATTR_VALUE_FOR_RANGE, src.valueForRange()); |
435 dst->AddFloatAttribute(ui::AX_ATTR_MAX_VALUE_FOR_RANGE, | 435 dst->AddFloatAttribute(ui::AX_ATTR_MAX_VALUE_FOR_RANGE, |
436 src.maxValueForRange()); | 436 src.maxValueForRange()); |
437 dst->AddFloatAttribute(ui::AX_ATTR_MIN_VALUE_FOR_RANGE, | 437 dst->AddFloatAttribute(ui::AX_ATTR_MIN_VALUE_FOR_RANGE, |
438 src.minValueForRange()); | 438 src.minValueForRange()); |
439 } | 439 } |
440 | 440 |
441 if (dst->role == ui::AX_ROLE_DOCUMENT || | 441 if (dst->role == ui::AX_ROLE_WEB_AREA) { |
442 dst->role == ui::AX_ROLE_WEB_AREA) { | |
443 dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document"); | 442 dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document"); |
444 const WebDocument& document = src.document(); | 443 const WebDocument& document = src.document(); |
445 if (name.empty()) | 444 if (name.empty()) |
446 name = UTF16ToUTF8(document.title()); | 445 name = UTF16ToUTF8(document.title()); |
447 dst->AddStringAttribute(ui::AX_ATTR_DOC_TITLE, | 446 dst->AddStringAttribute(ui::AX_ATTR_DOC_TITLE, |
448 UTF16ToUTF8(document.title())); | 447 UTF16ToUTF8(document.title())); |
449 dst->AddStringAttribute(ui::AX_ATTR_DOC_URL, document.url().spec()); | 448 dst->AddStringAttribute(ui::AX_ATTR_DOC_URL, document.url().spec()); |
450 dst->AddStringAttribute( | 449 dst->AddStringAttribute( |
451 ui::AX_ATTR_DOC_MIMETYPE, | 450 ui::AX_ATTR_DOC_MIMETYPE, |
452 document.isXHTMLDocument() ? "text/xhtml" : "text/html"); | 451 document.isXHTMLDocument() ? "text/xhtml" : "text/html"); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); | 589 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); |
591 } | 590 } |
592 | 591 |
593 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 592 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
594 if (render_frame_ && render_frame_->GetWebFrame()) | 593 if (render_frame_ && render_frame_->GetWebFrame()) |
595 return render_frame_->GetWebFrame()->document(); | 594 return render_frame_->GetWebFrame()->document(); |
596 return WebDocument(); | 595 return WebDocument(); |
597 } | 596 } |
598 | 597 |
599 } // namespace content | 598 } // namespace content |
OLD | NEW |