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

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

Issue 1762143002: Use unique IDs for accessibility nodes on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null obj deref in DCHECK Created 4 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 <atk/atk.h> 7 #include <atk/atk.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 AccessibilityTreeFormatterAuraLinux::~AccessibilityTreeFormatterAuraLinux() { 41 AccessibilityTreeFormatterAuraLinux::~AccessibilityTreeFormatterAuraLinux() {
42 } 42 }
43 43
44 void AccessibilityTreeFormatterAuraLinux::AddProperties( 44 void AccessibilityTreeFormatterAuraLinux::AddProperties(
45 const BrowserAccessibility& node, 45 const BrowserAccessibility& node,
46 base::DictionaryValue* dict) { 46 base::DictionaryValue* dict) {
47 dict->SetInteger("id", node.GetId()); 47 dict->SetInteger("id", node.GetId());
48 BrowserAccessibilityAuraLinux* acc_obj = 48 BrowserAccessibilityAuraLinux* acc_obj =
49 const_cast<BrowserAccessibility*>(&node) 49 ToBrowserAccessibilityAuraLinux(const_cast<BrowserAccessibility*>(&node));
50 ->ToBrowserAccessibilityAuraLinux();
51 50
52 AtkObject* atk_object = acc_obj->GetAtkObject(); 51 AtkObject* atk_object = acc_obj->GetAtkObject();
53 AtkRole role = acc_obj->atk_role(); 52 AtkRole role = acc_obj->atk_role();
54 if (role != ATK_ROLE_UNKNOWN) 53 if (role != ATK_ROLE_UNKNOWN)
55 dict->SetString("role", atk_role_get_name(role)); 54 dict->SetString("role", atk_role_get_name(role));
56 dict->SetString("name", atk_object_get_name(atk_object)); 55 dict->SetString("name", atk_object_get_name(atk_object));
57 dict->SetString("description", atk_object_get_description(atk_object)); 56 dict->SetString("description", atk_object_get_description(atk_object));
58 AtkStateSet* state_set = atk_object_ref_state_set(atk_object); 57 AtkStateSet* state_set = atk_object_ref_state_set(atk_object);
59 base::ListValue* states = new base::ListValue; 58 base::ListValue* states = new base::ListValue;
60 for (int i = ATK_STATE_INVALID; i < ATK_STATE_LAST_DEFINED; i++) { 59 for (int i = ATK_STATE_INVALID; i < ATK_STATE_LAST_DEFINED; i++) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 111
113 const std::string AccessibilityTreeFormatterAuraLinux::GetAllowString() { 112 const std::string AccessibilityTreeFormatterAuraLinux::GetAllowString() {
114 return "@AURALINUX-ALLOW:"; 113 return "@AURALINUX-ALLOW:";
115 } 114 }
116 115
117 const std::string AccessibilityTreeFormatterAuraLinux::GetDenyString() { 116 const std::string AccessibilityTreeFormatterAuraLinux::GetDenyString() {
118 return "@AURALINUX-DENY:"; 117 return "@AURALINUX-DENY:";
119 } 118 }
120 119
121 } 120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698