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

Side by Side Diff: Source/core/accessibility/AXObject.cpp

Issue 704363004: Add an accessibility setting to expose password values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 16 matching lines...) Expand all
27 */ 27 */
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "core/accessibility/AXObject.h" 30 #include "core/accessibility/AXObject.h"
31 31
32 #include "core/accessibility/AXObjectCacheImpl.h" 32 #include "core/accessibility/AXObjectCacheImpl.h"
33 #include "core/dom/NodeTraversal.h" 33 #include "core/dom/NodeTraversal.h"
34 #include "core/editing/VisibleUnits.h" 34 #include "core/editing/VisibleUnits.h"
35 #include "core/editing/htmlediting.h" 35 #include "core/editing/htmlediting.h"
36 #include "core/frame/LocalFrame.h" 36 #include "core/frame/LocalFrame.h"
37 #include "core/frame/Settings.h"
37 #include "core/rendering/RenderListItem.h" 38 #include "core/rendering/RenderListItem.h"
38 #include "core/rendering/RenderTheme.h" 39 #include "core/rendering/RenderTheme.h"
39 #include "core/rendering/RenderView.h" 40 #include "core/rendering/RenderView.h"
40 #include "platform/UserGestureIndicator.h" 41 #include "platform/UserGestureIndicator.h"
41 #include "platform/text/PlatformLocale.h" 42 #include "platform/text/PlatformLocale.h"
42 #include "wtf/StdLibExtras.h" 43 #include "wtf/StdLibExtras.h"
43 #include "wtf/text/WTFString.h" 44 #include "wtf/text/WTFString.h"
44 45
45 using blink::WebLocalizedString; 46 using blink::WebLocalizedString;
46 47
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 case MenuButtonRole: 208 case MenuButtonRole:
208 case MenuItemRole: 209 case MenuItemRole:
209 case MenuItemCheckBoxRole: 210 case MenuItemCheckBoxRole:
210 case MenuItemRadioRole: 211 case MenuItemRadioRole:
211 return true; 212 return true;
212 default: 213 default:
213 return false; 214 return false;
214 } 215 }
215 } 216 }
216 217
218 bool AXObject::isPasswordFieldAndShouldHideValue() const
219 {
220 if (!isPasswordField())
221 return false;
222
223 Settings* settings = document()->settings();
224 if (!settings || settings->accessibilityPasswordValuesEnabled())
225 return false;
226
227 return true;
Mike West 2014/11/07 09:51:28 Nit: This seems slightly more readable if you drop
dmazzoni 2014/11/07 22:33:42 Done.
228 }
229
217 bool AXObject::isTextControl() const 230 bool AXObject::isTextControl() const
218 { 231 {
219 switch (roleValue()) { 232 switch (roleValue()) {
220 case TextAreaRole: 233 case TextAreaRole:
221 case TextFieldRole: 234 case TextFieldRole:
222 case ComboBoxRole: 235 case ComboBoxRole:
223 return true; 236 return true;
224 default: 237 default:
225 return false; 238 return false;
226 } 239 }
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 return ToggleButtonRole; 980 return ToggleButtonRole;
968 if (ariaHasPopup()) 981 if (ariaHasPopup())
969 return PopUpButtonRole; 982 return PopUpButtonRole;
970 // We don't contemplate RadioButtonRole, as it depends on the input 983 // We don't contemplate RadioButtonRole, as it depends on the input
971 // type. 984 // type.
972 985
973 return ButtonRole; 986 return ButtonRole;
974 } 987 }
975 988
976 } // namespace blink 989 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698