OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/accessibility/browser_accessibility_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_win.h" |
6 | 6 |
7 #include <UIAutomationClient.h> | 7 #include <UIAutomationClient.h> |
8 #include <UIAutomationCoreApi.h> | 8 #include <UIAutomationCoreApi.h> |
9 | 9 |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 2695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2706 ia2_attributes_.push_back(string16(L"table-cell-index:") + | 2706 ia2_attributes_.push_back(string16(L"table-cell-index:") + |
2707 base::IntToString16(index)); | 2707 base::IntToString16(index)); |
2708 } | 2708 } |
2709 } else { | 2709 } else { |
2710 NOTREACHED(); | 2710 NOTREACHED(); |
2711 } | 2711 } |
2712 } | 2712 } |
2713 | 2713 |
2714 if (name_.empty() && | 2714 if (name_.empty() && |
2715 (role_ == WebAccessibility::ROLE_LISTBOX_OPTION || | 2715 (role_ == WebAccessibility::ROLE_LISTBOX_OPTION || |
2716 role_ == WebAccessibility::ROLE_STATIC_TEXT)) { | 2716 role_ == WebAccessibility::ROLE_STATIC_TEXT || |
| 2717 role_ == WebAccessibility::ROLE_LIST_MARKER)) { |
2717 name_.swap(value_); | 2718 name_.swap(value_); |
2718 } | 2719 } |
2719 | 2720 |
2720 // If this object doesn't have a name but it does have a description, | 2721 // If this object doesn't have a name but it does have a description, |
2721 // use the description as its name - because some screen readers only | 2722 // use the description as its name - because some screen readers only |
2722 // announce the name. | 2723 // announce the name. |
2723 if (name_.empty()) | 2724 if (name_.empty()) |
2724 GetStringAttribute(WebAccessibility::ATTR_DESCRIPTION, &name_); | 2725 GetStringAttribute(WebAccessibility::ATTR_DESCRIPTION, &name_); |
2725 | 2726 |
2726 // If this doesn't have a value and is linked then set its value to the url | 2727 // If this doesn't have a value and is linked then set its value to the url |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3371 } | 3372 } |
3372 | 3373 |
3373 // The role should always be set. | 3374 // The role should always be set. |
3374 DCHECK(!role_name_.empty() || ia_role_); | 3375 DCHECK(!role_name_.empty() || ia_role_); |
3375 | 3376 |
3376 // If we didn't explicitly set the IAccessible2 role, make it the same | 3377 // If we didn't explicitly set the IAccessible2 role, make it the same |
3377 // as the MSAA role. | 3378 // as the MSAA role. |
3378 if (!ia2_role_) | 3379 if (!ia2_role_) |
3379 ia2_role_ = ia_role_; | 3380 ia2_role_ = ia_role_; |
3380 } | 3381 } |
OLD | NEW |