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

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

Issue 10823073: Improve accessible name calculation on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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/dump_accessibility_tree_helper.h" 5 #include "content/browser/accessibility/dump_accessibility_tree_helper.h"
6 6
7 #include <oleacc.h> 7 #include <oleacc.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 24 matching lines...) Expand all
35 HRESULT hresult = acc_obj->get_accName(variant_self, &msaa_name_variant); 35 HRESULT hresult = acc_obj->get_accName(variant_self, &msaa_name_variant);
36 string16 name; 36 string16 name;
37 if (S_OK == hresult) 37 if (S_OK == hresult)
38 name = msaa_name_variant.m_str; 38 name = msaa_name_variant.m_str;
39 39
40 // Get state strings. 40 // Get state strings.
41 std::vector<string16> state_strings; 41 std::vector<string16> state_strings;
42 IAccessibleStateToStringVector(acc_obj->ia_state(), &state_strings); 42 IAccessibleStateToStringVector(acc_obj->ia_state(), &state_strings);
43 IAccessible2StateToStringVector(acc_obj->ia2_state(), &state_strings); 43 IAccessible2StateToStringVector(acc_obj->ia2_state(), &state_strings);
44 44
45 // Get the description and attributes. 45 // Get the description, help, and attributes.
46 string16 description; 46 string16 description;
47 acc_obj->GetStringAttribute(content::AccessibilityNodeData::ATTR_DESCRIPTION, 47 acc_obj->GetStringAttribute(content::AccessibilityNodeData::ATTR_DESCRIPTION,
48 &description); 48 &description);
49 string16 help;
50 acc_obj->GetStringAttribute(content::AccessibilityNodeData::ATTR_HELP, &help);
49 const std::vector<string16>& ia2_attributes = acc_obj->ia2_attributes(); 51 const std::vector<string16>& ia2_attributes = acc_obj->ia2_attributes();
50 52
51 // Build the line. 53 // Build the line.
52 StartLine(); 54 StartLine();
53 Add(true, IAccessible2RoleToString(acc_obj->ia2_role())); 55 Add(true, IAccessible2RoleToString(acc_obj->ia2_role()));
54 Add(true, L"name='" + name + L"'"); 56 Add(true, L"name='" + name + L"'");
55 for (std::vector<string16>::const_iterator it = state_strings.begin(); 57 for (std::vector<string16>::const_iterator it = state_strings.begin();
56 it != state_strings.end(); 58 it != state_strings.end();
57 ++it) { 59 ++it) {
58 Add(false, *it); 60 Add(false, *it);
(...skipping 20 matching lines...) Expand all
79 } 81 }
80 82
81 83
82 const std::string DumpAccessibilityTreeHelper::GetAllowString() const { 84 const std::string DumpAccessibilityTreeHelper::GetAllowString() const {
83 return "@WIN-ALLOW:"; 85 return "@WIN-ALLOW:";
84 } 86 }
85 87
86 const std::string DumpAccessibilityTreeHelper::GetDenyString() const { 88 const std::string DumpAccessibilityTreeHelper::GetDenyString() const {
87 return "@WIN-DENY:"; 89 return "@WIN-DENY:";
88 } 90 }
OLDNEW
« no previous file with comments | « content/browser/accessibility/dump_accessibility_tree_helper.cc ('k') | content/test/data/accessibility/button-name-calc.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698