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

Side by Side Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 12481022: On Win, the accessible value of a document should be its url. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
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 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 HasState(AccessibilityNodeData::STATE_FOCUSABLE) && 2780 HasState(AccessibilityNodeData::STATE_FOCUSABLE) &&
2781 GetHtmlAttribute("placeholder", &placeholder)) { 2781 GetHtmlAttribute("placeholder", &placeholder)) {
2782 if (name_.empty() && !title_elem_id) { 2782 if (name_.empty() && !title_elem_id) {
2783 name_ = placeholder; 2783 name_ = placeholder;
2784 } else if (description.empty()) { 2784 } else if (description.empty()) {
2785 description = placeholder; 2785 description = placeholder;
2786 string_attributes_[AccessibilityNodeData::ATTR_DESCRIPTION] = description; 2786 string_attributes_[AccessibilityNodeData::ATTR_DESCRIPTION] = description;
2787 } 2787 }
2788 } 2788 }
2789 2789
2790 // On Windows, the value of a document should be its url.
2791 if (role_ == AccessibilityNodeData::ROLE_ROOT_WEB_AREA ||
2792 role_ == AccessibilityNodeData::ROLE_WEB_AREA) {
2793 GetStringAttribute(AccessibilityNodeData::ATTR_DOC_URL, &value_);
2794 }
2795
2790 // For certain roles (listbox option, static text, and list marker) 2796 // For certain roles (listbox option, static text, and list marker)
2791 // WebKit stores the main accessible text in the "value" - swap it so 2797 // WebKit stores the main accessible text in the "value" - swap it so
2792 // that it's the "name". 2798 // that it's the "name".
2793 if (name_.empty() && 2799 if (name_.empty() &&
2794 (role_ == AccessibilityNodeData::ROLE_LISTBOX_OPTION || 2800 (role_ == AccessibilityNodeData::ROLE_LISTBOX_OPTION ||
2795 role_ == AccessibilityNodeData::ROLE_STATIC_TEXT || 2801 role_ == AccessibilityNodeData::ROLE_STATIC_TEXT ||
2796 role_ == AccessibilityNodeData::ROLE_LIST_MARKER)) { 2802 role_ == AccessibilityNodeData::ROLE_LIST_MARKER)) {
2797 name_.swap(value_); 2803 name_.swap(value_);
2798 } 2804 }
2799 2805
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
3511 // The role should always be set. 3517 // The role should always be set.
3512 DCHECK(!role_name_.empty() || ia_role_); 3518 DCHECK(!role_name_.empty() || ia_role_);
3513 3519
3514 // If we didn't explicitly set the IAccessible2 role, make it the same 3520 // If we didn't explicitly set the IAccessible2 role, make it the same
3515 // as the MSAA role. 3521 // as the MSAA role.
3516 if (!ia2_role_) 3522 if (!ia2_role_)
3517 ia2_role_ = ia_role_; 3523 ia2_role_ = ia_role_;
3518 } 3524 }
3519 3525
3520 } // namespace content 3526 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698