| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 return gfx::RectF(r.point.x, r.point.y, r.size.width, r.size.height); | 251 return gfx::RectF(r.point.x, r.point.y, r.size.width, r.size.height); |
| 252 } | 252 } |
| 253 | 253 |
| 254 ui::AXNodeData* PdfAccessibilityTree::CreateNode(ui::AXRole role) { | 254 ui::AXNodeData* PdfAccessibilityTree::CreateNode(ui::AXRole role) { |
| 255 content::RenderAccessibility* render_accessibility = GetRenderAccessibility(); | 255 content::RenderAccessibility* render_accessibility = GetRenderAccessibility(); |
| 256 DCHECK(render_accessibility); | 256 DCHECK(render_accessibility); |
| 257 | 257 |
| 258 ui::AXNodeData* node = new ui::AXNodeData(); | 258 ui::AXNodeData* node = new ui::AXNodeData(); |
| 259 node->id = render_accessibility->GenerateAXID(); | 259 node->id = render_accessibility->GenerateAXID(); |
| 260 node->role = role; | 260 node->role = role; |
| 261 node->state = 1 << ui::AX_STATE_ENABLED | 1 << ui::AX_STATE_READ_ONLY; | 261 node->state = 1 << ui::AX_STATE_READ_ONLY; |
| 262 nodes_.push_back(base::WrapUnique(node)); | 262 nodes_.push_back(base::WrapUnique(node)); |
| 263 return node; | 263 return node; |
| 264 } | 264 } |
| 265 | 265 |
| 266 float PdfAccessibilityTree::GetDeviceScaleFactor() const { | 266 float PdfAccessibilityTree::GetDeviceScaleFactor() const { |
| 267 content::RenderFrame* render_frame = | 267 content::RenderFrame* render_frame = |
| 268 host_->GetRenderFrameForInstance(instance_); | 268 host_->GetRenderFrameForInstance(instance_); |
| 269 DCHECK(render_frame); | 269 DCHECK(render_frame); |
| 270 return render_frame->GetRenderView()->GetDeviceScaleFactor(); | 270 return render_frame->GetRenderView()->GetDeviceScaleFactor(); |
| 271 } | 271 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 const ui::AXNode* PdfAccessibilityTree::GetNull() const { | 319 const ui::AXNode* PdfAccessibilityTree::GetNull() const { |
| 320 return nullptr; | 320 return nullptr; |
| 321 } | 321 } |
| 322 | 322 |
| 323 void PdfAccessibilityTree::SerializeNode( | 323 void PdfAccessibilityTree::SerializeNode( |
| 324 const ui::AXNode* node, ui::AXNodeData* out_data) const { | 324 const ui::AXNode* node, ui::AXNodeData* out_data) const { |
| 325 *out_data = node->data(); | 325 *out_data = node->data(); |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace pdf | 328 } // namespace pdf |
| OLD | NEW |