Chromium Code Reviews| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 dst->role == ui::AX_ROLE_SCROLL_BAR || | 425 dst->role == ui::AX_ROLE_SCROLL_BAR || |
| 426 dst->role == ui::AX_ROLE_SLIDER || | 426 dst->role == ui::AX_ROLE_SLIDER || |
| 427 dst->role == ui::AX_ROLE_SPIN_BUTTON) { | 427 dst->role == ui::AX_ROLE_SPIN_BUTTON) { |
| 428 dst->AddFloatAttribute(ui::AX_ATTR_VALUE_FOR_RANGE, src.valueForRange()); | 428 dst->AddFloatAttribute(ui::AX_ATTR_VALUE_FOR_RANGE, src.valueForRange()); |
| 429 dst->AddFloatAttribute(ui::AX_ATTR_MAX_VALUE_FOR_RANGE, | 429 dst->AddFloatAttribute(ui::AX_ATTR_MAX_VALUE_FOR_RANGE, |
| 430 src.maxValueForRange()); | 430 src.maxValueForRange()); |
| 431 dst->AddFloatAttribute(ui::AX_ATTR_MIN_VALUE_FOR_RANGE, | 431 dst->AddFloatAttribute(ui::AX_ATTR_MIN_VALUE_FOR_RANGE, |
| 432 src.minValueForRange()); | 432 src.minValueForRange()); |
| 433 } | 433 } |
| 434 | 434 |
| 435 if (dst->role == ui::AX_ROLE_DOCUMENT || | 435 if (dst->role == ui::AX_ROLE_WEB_AREA) { |
|
dmazzoni
2015/01/28 19:29:01
Fixing the other issues exposed this small bug. Ou
| |
| 436 dst->role == ui::AX_ROLE_WEB_AREA) { | |
| 437 dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document"); | 436 dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document"); |
| 438 const WebDocument& document = src.document(); | 437 const WebDocument& document = src.document(); |
| 439 if (name.empty()) | 438 if (name.empty()) |
| 440 name = UTF16ToUTF8(document.title()); | 439 name = UTF16ToUTF8(document.title()); |
| 441 dst->AddStringAttribute(ui::AX_ATTR_DOC_TITLE, | 440 dst->AddStringAttribute(ui::AX_ATTR_DOC_TITLE, |
| 442 UTF16ToUTF8(document.title())); | 441 UTF16ToUTF8(document.title())); |
| 443 dst->AddStringAttribute(ui::AX_ATTR_DOC_URL, document.url().spec()); | 442 dst->AddStringAttribute(ui::AX_ATTR_DOC_URL, document.url().spec()); |
| 444 dst->AddStringAttribute( | 443 dst->AddStringAttribute( |
| 445 ui::AX_ATTR_DOC_MIMETYPE, | 444 ui::AX_ATTR_DOC_MIMETYPE, |
| 446 document.isXHTMLDocument() ? "text/xhtml" : "text/html"); | 445 document.isXHTMLDocument() ? "text/xhtml" : "text/html"); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); | 583 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); |
| 585 } | 584 } |
| 586 | 585 |
| 587 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 586 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
| 588 if (render_frame_ && render_frame_->GetWebFrame()) | 587 if (render_frame_ && render_frame_->GetWebFrame()) |
| 589 return render_frame_->GetWebFrame()->document(); | 588 return render_frame_->GetWebFrame()->document(); |
| 590 return WebDocument(); | 589 return WebDocument(); |
| 591 } | 590 } |
| 592 | 591 |
| 593 } // namespace content | 592 } // namespace content |
| OLD | NEW |