Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: components/pdf/renderer/pdf_accessibility_tree.h

Issue 2100753003: Enable PDF accessibility when RenderFrame's accessibility mode changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win assertion Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 RenderFrame;
21 class RenderView;
22 } 21 }
23 22
24 namespace pdf { 23 namespace pdf {
25 24
26 class PdfAccessibilityTree 25 class PdfAccessibilityTree
27 : public ui::AXTreeSource<const ui::AXNode*, 26 : public ui::AXTreeSource<const ui::AXNode*,
28 ui::AXNodeData, 27 ui::AXNodeData,
29 ui::AXTreeData> { 28 ui::AXTreeData> {
30 public: 29 public:
31 explicit PdfAccessibilityTree(content::RenderView* render_view); 30 explicit PdfAccessibilityTree(content::RenderFrame* render_frame);
32 ~PdfAccessibilityTree() override; 31 ~PdfAccessibilityTree() override;
33 32
34 void SetAccessibilityViewportInfo( 33 void SetAccessibilityViewportInfo(
35 const PP_PrivateAccessibilityViewportInfo& viewport_info); 34 const PP_PrivateAccessibilityViewportInfo& viewport_info);
36 void SetAccessibilityDocInfo( 35 void SetAccessibilityDocInfo(
37 const PP_PrivateAccessibilityDocInfo& doc_info); 36 const PP_PrivateAccessibilityDocInfo& doc_info);
38 void SetAccessibilityPageInfo( 37 void SetAccessibilityPageInfo(
39 const PP_PrivateAccessibilityPageInfo& page_info, 38 const PP_PrivateAccessibilityPageInfo& page_info,
40 const std::vector<PP_PrivateAccessibilityTextRunInfo>& text_runs, 39 const std::vector<PP_PrivateAccessibilityTextRunInfo>& text_runs,
41 const std::vector<PP_PrivateAccessibilityCharInfo>& chars); 40 const std::vector<PP_PrivateAccessibilityCharInfo>& chars);
(...skipping 26 matching lines...) Expand all
68 std::vector<int32_t> GetTextRunCharOffsets( 67 std::vector<int32_t> GetTextRunCharOffsets(
69 const PP_PrivateAccessibilityTextRunInfo& text_run, 68 const PP_PrivateAccessibilityTextRunInfo& text_run,
70 const std::vector<PP_PrivateAccessibilityCharInfo>& chars, 69 const std::vector<PP_PrivateAccessibilityCharInfo>& chars,
71 int char_index); 70 int char_index);
72 gfx::Vector2dF ToVector2dF(const PP_Point& p); 71 gfx::Vector2dF ToVector2dF(const PP_Point& p);
73 gfx::RectF ToRectF(const PP_Rect& r); 72 gfx::RectF ToRectF(const PP_Rect& r);
74 ui::AXNodeData* CreateNode(ui::AXRole role); 73 ui::AXNodeData* CreateNode(ui::AXRole role);
75 float GetDeviceScaleFactor() const; 74 float GetDeviceScaleFactor() const;
76 75
77 ui::AXTree tree_; 76 ui::AXTree tree_;
78 content::RenderView* render_view_; 77 content::RenderFrame* render_frame_;
79 content::RenderAccessibility* render_accessibility_;
80 double zoom_; 78 double zoom_;
81 gfx::Vector2dF scroll_; 79 gfx::Vector2dF scroll_;
82 gfx::Vector2dF offset_; 80 gfx::Vector2dF offset_;
83 PP_PrivateAccessibilityDocInfo doc_info_; 81 PP_PrivateAccessibilityDocInfo doc_info_;
84 ui::AXNodeData* doc_node_; 82 ui::AXNodeData* doc_node_;
85 std::vector<std::unique_ptr<ui::AXNodeData>> nodes_; 83 std::vector<std::unique_ptr<ui::AXNodeData>> nodes_;
86 }; 84 };
87 85
88 } // namespace pdf; 86 } // namespace pdf;
89 87
90 #endif // COMPONENTS_PDF_RENDERER_PDF_ACCESSIBILITY_TREE_H_ 88 #endif // COMPONENTS_PDF_RENDERER_PDF_ACCESSIBILITY_TREE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698