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

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

Issue 2833843005: Handling of different types of empty alt (Closed)
Patch Set: Ready to land Created 3 years, 7 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
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/accessibility_tree_formatter.h" 5 #include "content/browser/accessibility/accessibility_tree_formatter.h"
6 6
7 #include <oleacc.h> 7 #include <oleacc.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ToBrowserAccessibilityWin(const_cast<BrowserAccessibility*>(&node)); 164 ToBrowserAccessibilityWin(const_cast<BrowserAccessibility*>(&node));
165 DCHECK(ax_object); 165 DCHECK(ax_object);
166 166
167 VARIANT variant_self; 167 VARIANT variant_self;
168 variant_self.vt = VT_I4; 168 variant_self.vt = VT_I4;
169 variant_self.lVal = CHILDID_SELF; 169 variant_self.lVal = CHILDID_SELF;
170 170
171 dict->SetString("role", IAccessible2RoleToString(ax_object->ia2_role())); 171 dict->SetString("role", IAccessible2RoleToString(ax_object->ia2_role()));
172 172
173 base::win::ScopedBstr temp_bstr; 173 base::win::ScopedBstr temp_bstr;
174 if (SUCCEEDED(ax_object->get_accName(variant_self, temp_bstr.Receive()))) { 174 // If S_FALSE it means there is no name
175 if (S_OK == ax_object->get_accName(variant_self, temp_bstr.Receive())) {
175 base::string16 name = base::string16(temp_bstr, temp_bstr.Length()); 176 base::string16 name = base::string16(temp_bstr, temp_bstr.Length());
176 177
177 // Ignore a JAWS workaround where the name of a document is " ". 178 // Ignore a JAWS workaround where the name of a document is " ".
178 if (name != L" " || ax_object->ia2_role() != ROLE_SYSTEM_DOCUMENT) 179 if (name != L" " || ax_object->ia2_role() != ROLE_SYSTEM_DOCUMENT)
179 dict->SetString("name", name); 180 dict->SetString("name", name);
180 } 181 }
181 temp_bstr.Reset(); 182 temp_bstr.Reset();
182 183
183 if (SUCCEEDED(ax_object->get_accValue(variant_self, temp_bstr.Receive()))) 184 if (SUCCEEDED(ax_object->get_accValue(variant_self, temp_bstr.Receive())))
184 dict->SetString("value", base::string16(temp_bstr, temp_bstr.Length())); 185 dict->SetString("value", base::string16(temp_bstr, temp_bstr.Length()));
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 447
447 const std::string AccessibilityTreeFormatterWin::GetAllowString() { 448 const std::string AccessibilityTreeFormatterWin::GetAllowString() {
448 return "@WIN-ALLOW:"; 449 return "@WIN-ALLOW:";
449 } 450 }
450 451
451 const std::string AccessibilityTreeFormatterWin::GetDenyString() { 452 const std::string AccessibilityTreeFormatterWin::GetDenyString() {
452 return "@WIN-DENY:"; 453 return "@WIN-DENY:";
453 } 454 }
454 455
455 } // namespace content 456 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698