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 #ifndef COMPONENTS_PDF_RENDERER_PDF_ACCESSIBILITY_TREE_H_ | 5 #ifndef COMPONENTS_PDF_RENDERER_PDF_ACCESSIBILITY_TREE_H_ |
6 #define COMPONENTS_PDF_RENDERER_PDF_ACCESSIBILITY_TREE_H_ | 6 #define COMPONENTS_PDF_RENDERER_PDF_ACCESSIBILITY_TREE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ppapi/c/pp_instance.h" | 11 #include "ppapi/c/pp_instance.h" |
12 #include "ppapi/c/private/ppb_pdf.h" | 12 #include "ppapi/c/private/ppb_pdf.h" |
13 #include "ui/accessibility/ax_node.h" | 13 #include "ui/accessibility/ax_node.h" |
14 #include "ui/accessibility/ax_tree.h" | 14 #include "ui/accessibility/ax_tree.h" |
15 #include "ui/accessibility/ax_tree_source.h" | 15 #include "ui/accessibility/ax_tree_source.h" |
16 #include "ui/gfx/geometry/rect_f.h" | 16 #include "ui/gfx/geometry/rect_f.h" |
17 #include "ui/gfx/geometry/vector2d_f.h" | 17 #include "ui/gfx/geometry/vector2d_f.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class RenderAccessibility; | 20 class RenderAccessibility; |
21 class RenderFrame; | 21 class RenderFrame; |
22 class RendererPpapiHost; | 22 class RendererPpapiHost; |
23 } | 23 } |
24 | 24 |
| 25 namespace gfx { |
| 26 class Transform; |
| 27 }; |
| 28 |
25 namespace pdf { | 29 namespace pdf { |
26 | 30 |
27 class PdfAccessibilityTree | 31 class PdfAccessibilityTree |
28 : public ui::AXTreeSource<const ui::AXNode*, | 32 : public ui::AXTreeSource<const ui::AXNode*, |
29 ui::AXNodeData, | 33 ui::AXNodeData, |
30 ui::AXTreeData> { | 34 ui::AXTreeData> { |
31 public: | 35 public: |
32 PdfAccessibilityTree(content::RendererPpapiHost* host, | 36 PdfAccessibilityTree(content::RendererPpapiHost* host, |
33 PP_Instance instance); | 37 PP_Instance instance); |
34 ~PdfAccessibilityTree() override; | 38 ~PdfAccessibilityTree() override; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 int char_index); | 73 int char_index); |
70 std::vector<int32_t> GetTextRunCharOffsets( | 74 std::vector<int32_t> GetTextRunCharOffsets( |
71 const PP_PrivateAccessibilityTextRunInfo& text_run, | 75 const PP_PrivateAccessibilityTextRunInfo& text_run, |
72 const std::vector<PP_PrivateAccessibilityCharInfo>& chars, | 76 const std::vector<PP_PrivateAccessibilityCharInfo>& chars, |
73 int char_index); | 77 int char_index); |
74 gfx::Vector2dF ToVector2dF(const PP_Point& p); | 78 gfx::Vector2dF ToVector2dF(const PP_Point& p); |
75 gfx::RectF ToRectF(const PP_Rect& r); | 79 gfx::RectF ToRectF(const PP_Rect& r); |
76 ui::AXNodeData* CreateNode(ui::AXRole role); | 80 ui::AXNodeData* CreateNode(ui::AXRole role); |
77 float GetDeviceScaleFactor() const; | 81 float GetDeviceScaleFactor() const; |
78 content::RenderAccessibility* GetRenderAccessibility(); | 82 content::RenderAccessibility* GetRenderAccessibility(); |
| 83 gfx::Transform* MakeTransformFromViewInfo(); |
79 | 84 |
80 ui::AXTree tree_; | 85 ui::AXTree tree_; |
81 content::RendererPpapiHost* host_; | 86 content::RendererPpapiHost* host_; |
82 PP_Instance instance_; | 87 PP_Instance instance_; |
83 double zoom_; | 88 double zoom_; |
84 gfx::Vector2dF scroll_; | 89 gfx::Vector2dF scroll_; |
85 gfx::Vector2dF offset_; | 90 gfx::Vector2dF offset_; |
86 PP_PrivateAccessibilityDocInfo doc_info_; | 91 PP_PrivateAccessibilityDocInfo doc_info_; |
87 ui::AXNodeData* doc_node_; | 92 ui::AXNodeData* doc_node_; |
88 std::vector<std::unique_ptr<ui::AXNodeData>> nodes_; | 93 std::vector<std::unique_ptr<ui::AXNodeData>> nodes_; |
89 }; | 94 }; |
90 | 95 |
91 } // namespace pdf; | 96 } // namespace pdf; |
92 | 97 |
93 #endif // COMPONENTS_PDF_RENDERER_PDF_ACCESSIBILITY_TREE_H_ | 98 #endif // COMPONENTS_PDF_RENDERER_PDF_ACCESSIBILITY_TREE_H_ |
OLD | NEW |