| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversion_utils.h" | 9 #include "base/strings/utf_string_conversion_utils.h" |
| 10 #include "components/pdf/renderer/pdf_accessibility_tree.h" | 10 #include "components/pdf/renderer/pdf_accessibility_tree.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 gfx::RectF PdfAccessibilityTree::ToRectF(const PP_Rect& r) { | 267 gfx::RectF PdfAccessibilityTree::ToRectF(const PP_Rect& r) { |
| 268 return gfx::RectF(r.point.x, r.point.y, r.size.width, r.size.height); | 268 return gfx::RectF(r.point.x, r.point.y, r.size.width, r.size.height); |
| 269 } | 269 } |
| 270 | 270 |
| 271 ui::AXNodeData* PdfAccessibilityTree::CreateNode(ui::AXRole role) { | 271 ui::AXNodeData* PdfAccessibilityTree::CreateNode(ui::AXRole role) { |
| 272 content::RenderAccessibility* render_accessibility = GetRenderAccessibility(); | 272 content::RenderAccessibility* render_accessibility = GetRenderAccessibility(); |
| 273 DCHECK(render_accessibility); | 273 DCHECK(render_accessibility); |
| 274 | 274 |
| 275 ui::AXNodeData* node = new ui::AXNodeData(); | 275 ui::AXNodeData* node = new ui::AXNodeData(); |
| 276 node->ClearBitfields(); |
| 276 node->id = render_accessibility->GenerateAXID(); | 277 node->id = render_accessibility->GenerateAXID(); |
| 277 node->role = role; | 278 node->role = role; |
| 278 node->state = 1 << ui::AX_STATE_READ_ONLY; | 279 node->AddState(ui::AX_STATE_READ_ONLY); |
| 279 | 280 |
| 280 // All nodes other than the first one have coordinates relative to | 281 // All nodes other than the first one have coordinates relative to |
| 281 // the first node. | 282 // the first node. |
| 282 if (nodes_.size() > 0) | 283 if (nodes_.size() > 0) |
| 283 node->offset_container_id = nodes_[0]->id; | 284 node->offset_container_id = nodes_[0]->id; |
| 284 | 285 |
| 285 nodes_.push_back(base::WrapUnique(node)); | 286 nodes_.push_back(base::WrapUnique(node)); |
| 286 | 287 |
| 287 return node; | 288 return node; |
| 288 } | 289 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 const ui::AXNode* PdfAccessibilityTree::GetNull() const { | 353 const ui::AXNode* PdfAccessibilityTree::GetNull() const { |
| 353 return nullptr; | 354 return nullptr; |
| 354 } | 355 } |
| 355 | 356 |
| 356 void PdfAccessibilityTree::SerializeNode( | 357 void PdfAccessibilityTree::SerializeNode( |
| 357 const ui::AXNode* node, ui::AXNodeData* out_data) const { | 358 const ui::AXNode* node, ui::AXNodeData* out_data) const { |
| 358 *out_data = node->data(); | 359 *out_data = node->data(); |
| 359 } | 360 } |
| 360 | 361 |
| 361 } // namespace pdf | 362 } // namespace pdf |
| OLD | NEW |