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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObject.cpp

Issue 2518183002: Moved action verbs out of Blink. (Closed)
Patch Set: Created 4 years 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 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 AccessibilityOrientation AXObject::orientation() const { 901 AccessibilityOrientation AXObject::orientation() const {
902 // In ARIA 1.1, the default value for aria-orientation changed from 902 // In ARIA 1.1, the default value for aria-orientation changed from
903 // horizontal to undefined. 903 // horizontal to undefined.
904 return AccessibilityOrientationUndefined; 904 return AccessibilityOrientationUndefined;
905 } 905 }
906 906
907 static String queryString(WebLocalizedString::Name name) { 907 static String queryString(WebLocalizedString::Name name) {
908 return Locale::defaultLocale().queryString(name); 908 return Locale::defaultLocale().queryString(name);
909 } 909 }
910 910
911 String AXObject::actionVerb() const { 911 AXSupportedAction AXObject::action() const {
912 if (!actionElement()) 912 if (!actionElement())
913 return emptyString(); 913 return AXSupportedAction::NONE;
914 914
915 switch (roleValue()) { 915 switch (roleValue()) {
916 case ButtonRole: 916 case ButtonRole:
917 case ToggleButtonRole: 917 case ToggleButtonRole:
918 return queryString(WebLocalizedString::AXButtonActionVerb); 918 return AXSupportedAction::PRESS;
919 case TextFieldRole: 919 case TextFieldRole:
920 return queryString(WebLocalizedString::AXTextFieldActionVerb); 920 return AXSupportedAction::ACTIVATE;
921 case RadioButtonRole: 921 case RadioButtonRole:
922 return queryString(WebLocalizedString::AXRadioButtonActionVerb); 922 return AXSupportedAction::SELECT;
923 case CheckBoxRole: 923 case CheckBoxRole:
924 case SwitchRole: 924 case SwitchRole:
925 return queryString( 925 return isChecked() ? AXSupportedAction::CHECK
926 isChecked() ? WebLocalizedString::AXCheckedCheckBoxActionVerb 926 : AXSupportedAction::UNCHECK;
927 : WebLocalizedString::AXUncheckedCheckBoxActionVerb);
928 case LinkRole: 927 case LinkRole:
929 return queryString(WebLocalizedString::AXLinkActionVerb); 928 return AXSupportedAction::JUMP;
930 case PopUpButtonRole: 929 case PopUpButtonRole:
931 return queryString(WebLocalizedString::AXPopUpButtonActionVerb); 930 return AXSupportedAction::OPEN;
932 default: 931 default:
933 return queryString(WebLocalizedString::AXDefaultActionVerb); 932 return AXSupportedAction::CLICK;
934 } 933 }
935 } 934 }
936 935
937 AccessibilityButtonState AXObject::checkboxOrRadioValue() const { 936 AccessibilityButtonState AXObject::checkboxOrRadioValue() const {
938 const AtomicString& checkedAttribute = getAttribute(aria_checkedAttr); 937 const AtomicString& checkedAttribute = getAttribute(aria_checkedAttr);
939 if (equalIgnoringCase(checkedAttribute, "true")) 938 if (equalIgnoringCase(checkedAttribute, "true"))
940 return ButtonStateOn; 939 return ButtonStateOn;
941 940
942 if (equalIgnoringCase(checkedAttribute, "mixed")) { 941 if (equalIgnoringCase(checkedAttribute, "mixed")) {
943 // Only checkboxes should support the mixed state. 942 // Only checkboxes should support the mixed state.
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 } 1741 }
1743 1742
1744 DEFINE_TRACE(AXObject) { 1743 DEFINE_TRACE(AXObject) {
1745 visitor->trace(m_children); 1744 visitor->trace(m_children);
1746 visitor->trace(m_parent); 1745 visitor->trace(m_parent);
1747 visitor->trace(m_cachedLiveRegionRoot); 1746 visitor->trace(m_cachedLiveRegionRoot);
1748 visitor->trace(m_axObjectCache); 1747 visitor->trace(m_axObjectCache);
1749 } 1748 }
1750 1749
1751 } // namespace blink 1750 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698