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

Side by Side Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 2694903010: AX checked state changes (Closed)
Patch Set: git cl try Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 AddIntListAttributeFromWebObjects( 420 AddIntListAttributeFromWebObjects(
421 ui::AX_ATTR_DESCRIBEDBY_IDS, descriptionObjects, dst); 421 ui::AX_ATTR_DESCRIBEDBY_IDS, descriptionObjects, dst);
422 } 422 }
423 423
424 if (src.ValueDescription().length()) { 424 if (src.ValueDescription().length()) {
425 dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.ValueDescription().Utf8()); 425 dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.ValueDescription().Utf8());
426 } else { 426 } else {
427 dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.StringValue().Utf8()); 427 dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.StringValue().Utf8());
428 } 428 }
429 429
430 if (src.IsButtonStateMixed())
431 dst->AddBoolAttribute(ui::AX_ATTR_STATE_MIXED, true);
432
433 if (src.CanSetValueAttribute()) 430 if (src.CanSetValueAttribute())
434 dst->AddBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE, true); 431 dst->AddBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE, true);
435 432
436 if (!src.Url().IsEmpty()) 433 if (!src.Url().IsEmpty())
437 dst->AddStringAttribute(ui::AX_ATTR_URL, src.Url().GetString().Utf8()); 434 dst->AddStringAttribute(ui::AX_ATTR_URL, src.Url().GetString().Utf8());
438 435
439 // The following set of attributes are only accessed when the accessibility 436 // The following set of attributes are only accessed when the accessibility
440 // mode is set to screen reader mode, otherwise only the more basic 437 // mode is set to screen reader mode, otherwise only the more basic
441 // attributes are populated. 438 // attributes are populated.
442 if (accessibility_mode_.has_mode(AccessibilityMode::kScreenReader)) { 439 if (accessibility_mode_.has_mode(AccessibilityMode::kScreenReader)) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 if (src.InvalidState()) { 483 if (src.InvalidState()) {
487 dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE, 484 dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE,
488 AXInvalidStateFromBlink(src.InvalidState())); 485 AXInvalidStateFromBlink(src.InvalidState()));
489 } 486 }
490 if (src.InvalidState() == blink::kWebAXInvalidStateOther && 487 if (src.InvalidState() == blink::kWebAXInvalidStateOther &&
491 src.AriaInvalidValue().length()) { 488 src.AriaInvalidValue().length()) {
492 dst->AddStringAttribute(ui::AX_ATTR_ARIA_INVALID_VALUE, 489 dst->AddStringAttribute(ui::AX_ATTR_ARIA_INVALID_VALUE,
493 src.AriaInvalidValue().Utf8()); 490 src.AriaInvalidValue().Utf8());
494 } 491 }
495 492
493 if (src.IsCheckable()) {
494 const blink::WebAXCheckedState checked_state = src.CheckedState();
495 dst->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE,
496 AXCheckedStateFromBlink(checked_state));
497 }
498
496 if (src.GetTextDirection()) { 499 if (src.GetTextDirection()) {
497 dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, 500 dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
498 AXTextDirectionFromBlink(src.GetTextDirection())); 501 AXTextDirectionFromBlink(src.GetTextDirection()));
499 } 502 }
500 503
501 if (src.TextStyle()) { 504 if (src.TextStyle()) {
502 dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE, 505 dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE,
503 AXTextStyleFromBlink(src.TextStyle())); 506 AXTextStyleFromBlink(src.TextStyle()));
504 } 507 }
505 508
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 return WebAXObject(); 885 return WebAXObject();
883 886
884 WebDocument document = render_frame_->GetWebFrame()->GetDocument(); 887 WebDocument document = render_frame_->GetWebFrame()->GetDocument();
885 if (!document.IsNull()) 888 if (!document.IsNull())
886 return document.AccessibilityObject(); 889 return document.AccessibilityObject();
887 890
888 return WebAXObject(); 891 return WebAXObject();
889 } 892 }
890 893
891 } // namespace content 894 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/accessibility/blink_ax_enum_conversion.cc ('k') | content/shell/test_runner/web_ax_object_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698