| 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 #include "ui/gfx/geometry/rect_conversions.h" |
| 10 #include "ui/gfx/transform.h" | 11 #include "ui/gfx/transform.h" |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 | 14 |
| 14 AccessibilityTreeFormatterBlink::AccessibilityTreeFormatterBlink() | 15 AccessibilityTreeFormatterBlink::AccessibilityTreeFormatterBlink() |
| 15 : AccessibilityTreeFormatter() { | 16 : AccessibilityTreeFormatter() { |
| 16 } | 17 } |
| 17 | 18 |
| 18 AccessibilityTreeFormatterBlink::~AccessibilityTreeFormatterBlink() { | 19 AccessibilityTreeFormatterBlink::~AccessibilityTreeFormatterBlink() { |
| 19 } | 20 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 35 return node.InternalGetChild(i); | 36 return node.InternalGetChild(i); |
| 36 } | 37 } |
| 37 | 38 |
| 38 void AccessibilityTreeFormatterBlink::AddProperties( | 39 void AccessibilityTreeFormatterBlink::AddProperties( |
| 39 const BrowserAccessibility& node, | 40 const BrowserAccessibility& node, |
| 40 base::DictionaryValue* dict) { | 41 base::DictionaryValue* dict) { |
| 41 dict->SetInteger("id", node.GetId()); | 42 dict->SetInteger("id", node.GetId()); |
| 42 | 43 |
| 43 dict->SetString("internalRole", ui::ToString(node.GetData().role)); | 44 dict->SetString("internalRole", ui::ToString(node.GetData().role)); |
| 44 | 45 |
| 45 gfx::Rect bounds = node.GetData().location; | 46 gfx::Rect bounds = gfx::ToEnclosingRect(node.GetData().location); |
| 46 dict->SetInteger("boundsX", bounds.x()); | 47 dict->SetInteger("boundsX", bounds.x()); |
| 47 dict->SetInteger("boundsY", bounds.y()); | 48 dict->SetInteger("boundsY", bounds.y()); |
| 48 dict->SetInteger("boundsWidth", bounds.width()); | 49 dict->SetInteger("boundsWidth", bounds.width()); |
| 49 dict->SetInteger("boundsHeight", bounds.height()); | 50 dict->SetInteger("boundsHeight", bounds.height()); |
| 50 | 51 |
| 51 gfx::Rect page_bounds = node.GetLocalBoundsRect(); | 52 gfx::Rect page_bounds = node.GetLocalBoundsRect(); |
| 52 dict->SetInteger("pageBoundsX", page_bounds.x()); | 53 dict->SetInteger("pageBoundsX", page_bounds.x()); |
| 53 dict->SetInteger("pageBoundsY", page_bounds.y()); | 54 dict->SetInteger("pageBoundsY", page_bounds.y()); |
| 54 dict->SetInteger("pageBoundsWidth", page_bounds.width()); | 55 dict->SetInteger("pageBoundsWidth", page_bounds.width()); |
| 55 dict->SetInteger("pageBoundsHeight", page_bounds.height()); | 56 dict->SetInteger("pageBoundsHeight", page_bounds.height()); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 236 |
| 236 const std::string AccessibilityTreeFormatterBlink::GetAllowString() { | 237 const std::string AccessibilityTreeFormatterBlink::GetAllowString() { |
| 237 return "@BLINK-ALLOW:"; | 238 return "@BLINK-ALLOW:"; |
| 238 } | 239 } |
| 239 | 240 |
| 240 const std::string AccessibilityTreeFormatterBlink::GetDenyString() { | 241 const std::string AccessibilityTreeFormatterBlink::GetDenyString() { |
| 241 return "@BLINK-DENY:"; | 242 return "@BLINK-DENY:"; |
| 242 } | 243 } |
| 243 | 244 |
| 244 } // namespace content | 245 } // namespace content |
| OLD | NEW |