Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "content/browser/accessibility/accessibility_tree_formatter_blink.h" | 9 #include "content/browser/accessibility/accessibility_tree_formatter_blink.h" |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 return node.PlatformGetChild(i); | 32 return node.PlatformGetChild(i); |
| 33 else | 33 else |
| 34 return node.InternalGetChild(i); | 34 return node.InternalGetChild(i); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void AccessibilityTreeFormatterBlink::AddProperties( | 37 void AccessibilityTreeFormatterBlink::AddProperties( |
| 38 const BrowserAccessibility& node, | 38 const BrowserAccessibility& node, |
| 39 base::DictionaryValue* dict) { | 39 base::DictionaryValue* dict) { |
| 40 dict->SetInteger("id", node.GetId()); | 40 dict->SetInteger("id", node.GetId()); |
| 41 | 41 |
| 42 dict->SetString("role", ui::ToString(node.GetData().role)); | 42 dict->SetString("internalRole", ui::ToString(node.GetData().role)); |
| 43 | 43 |
| 44 dict->SetInteger("boundsX", node.GetData().location.x()); | 44 dict->SetInteger("boundsX", node.GetData().location.x()); |
| 45 dict->SetInteger("boundsY", node.GetData().location.y()); | 45 dict->SetInteger("boundsY", node.GetData().location.y()); |
| 46 dict->SetInteger("boundsWidth", node.GetData().location.width()); | 46 dict->SetInteger("boundsWidth", node.GetData().location.width()); |
| 47 dict->SetInteger("boundsHeight", node.GetData().location.height()); | 47 dict->SetInteger("boundsHeight", node.GetData().location.height()); |
| 48 | 48 |
| 49 for (int state_index = ui::AX_STATE_NONE; | 49 for (int state_index = ui::AX_STATE_NONE; |
| 50 state_index <= ui::AX_STATE_LAST; | 50 state_index <= ui::AX_STATE_LAST; |
| 51 ++state_index) { | 51 ++state_index) { |
| 52 auto state = static_cast<ui::AXState>(state_index); | 52 auto state = static_cast<ui::AXState>(state_index); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 const base::DictionaryValue& dict) { | 105 const base::DictionaryValue& dict) { |
| 106 base::string16 line; | 106 base::string16 line; |
| 107 | 107 |
| 108 if (show_ids()) { | 108 if (show_ids()) { |
| 109 int id_value; | 109 int id_value; |
| 110 dict.GetInteger("id", &id_value); | 110 dict.GetInteger("id", &id_value); |
| 111 WriteAttribute(true, base::IntToString16(id_value), &line); | 111 WriteAttribute(true, base::IntToString16(id_value), &line); |
| 112 } | 112 } |
| 113 | 113 |
| 114 base::string16 role_value; | 114 base::string16 role_value; |
| 115 dict.GetString("role", &role_value); | 115 dict.GetString("internalRole", &role_value); |
|
David Tseng
2016/03/04 16:50:20
Why this change?
dmazzoni
2016/03/07 21:35:32
It conflicted with the string attribute "role" (wh
| |
| 116 WriteAttribute(true, base::UTF16ToUTF8(role_value), &line); | 116 WriteAttribute(true, base::UTF16ToUTF8(role_value), &line); |
| 117 | 117 |
| 118 for (int state_index = ui::AX_STATE_NONE; | 118 for (int state_index = ui::AX_STATE_NONE; |
| 119 state_index <= ui::AX_STATE_LAST; | 119 state_index <= ui::AX_STATE_LAST; |
| 120 ++state_index) { | 120 ++state_index) { |
| 121 auto state = static_cast<ui::AXState>(state_index); | 121 auto state = static_cast<ui::AXState>(state_index); |
| 122 const base::Value* value; | 122 const base::Value* value; |
| 123 if (!dict.Get(ui::ToString(state), &value)) | 123 if (!dict.Get(ui::ToString(state), &value)) |
| 124 continue; | 124 continue; |
| 125 | 125 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 | 210 |
| 211 const std::string AccessibilityTreeFormatterBlink::GetAllowString() { | 211 const std::string AccessibilityTreeFormatterBlink::GetAllowString() { |
| 212 return "@BLINK-ALLOW:"; | 212 return "@BLINK-ALLOW:"; |
| 213 } | 213 } |
| 214 | 214 |
| 215 const std::string AccessibilityTreeFormatterBlink::GetDenyString() { | 215 const std::string AccessibilityTreeFormatterBlink::GetDenyString() { |
| 216 return "@BLINK-DENY:"; | 216 return "@BLINK-DENY:"; |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace content | 219 } // namespace content |
| OLD | NEW |