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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 2640123004: Initial support for native accessibility in ARC (Closed)
Patch Set: Rebase. Created 3 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 using SmartClipCallback = base::Callback<void(const base::string16& text, 123 using SmartClipCallback = base::Callback<void(const base::string16& text,
124 const base::string16& html)>; 124 const base::string16& html)>;
125 125
126 // An accessibility reset is only allowed to prevent very rare corner cases 126 // An accessibility reset is only allowed to prevent very rare corner cases
127 // or race conditions where the browser and renderer get out of sync. If 127 // or race conditions where the browser and renderer get out of sync. If
128 // this happens more than this many times, kill the renderer. 128 // this happens more than this many times, kill the renderer.
129 static const int kMaxAccessibilityResets = 5; 129 static const int kMaxAccessibilityResets = 5;
130 130
131 static RenderFrameHostImpl* FromID(int process_id, int routing_id); 131 static RenderFrameHostImpl* FromID(int process_id, int routing_id);
132 static RenderFrameHostImpl* FromAXTreeID( 132 static RenderFrameHostImpl* FromAXTreeID(
133 AXTreeIDRegistry::AXTreeID ax_tree_id); 133 ui::AXTreeIDRegistry::AXTreeID ax_tree_id);
134 134
135 ~RenderFrameHostImpl() override; 135 ~RenderFrameHostImpl() override;
136 136
137 // RenderFrameHost 137 // RenderFrameHost
138 int GetRoutingID() override; 138 int GetRoutingID() override;
139 AXTreeIDRegistry::AXTreeID GetAXTreeID() override; 139 ui::AXTreeIDRegistry::AXTreeID GetAXTreeID() override;
140 SiteInstanceImpl* GetSiteInstance() override; 140 SiteInstanceImpl* GetSiteInstance() override;
141 RenderProcessHost* GetProcess() override; 141 RenderProcessHost* GetProcess() override;
142 RenderWidgetHostView* GetView() override; 142 RenderWidgetHostView* GetView() override;
143 RenderFrameHostImpl* GetParent() override; 143 RenderFrameHostImpl* GetParent() override;
144 int GetFrameTreeNodeId() override; 144 int GetFrameTreeNodeId() override;
145 const std::string& GetFrameName() override; 145 const std::string& GetFrameName() override;
146 bool IsCrossProcessSubframe() override; 146 bool IsCrossProcessSubframe() override;
147 const GURL& GetLastCommittedURL() override; 147 const GURL& GetLastCommittedURL() override;
148 const url::Origin& GetLastCommittedOrigin() override; 148 const url::Origin& GetLastCommittedOrigin() override;
149 gfx::NativeView GetNativeView() override; 149 gfx::NativeView GetNativeView() override;
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 const base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)>& 490 const base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)>&
491 callback); 491 callback);
492 492
493 // Called when the metadata about the accessibility tree for this frame 493 // Called when the metadata about the accessibility tree for this frame
494 // changes due to a browser-side change, as opposed to due to an IPC from 494 // changes due to a browser-side change, as opposed to due to an IPC from
495 // a renderer. 495 // a renderer.
496 void UpdateAXTreeData(); 496 void UpdateAXTreeData();
497 497
498 // Set the AX tree ID of the embedder RFHI, if this is a browser plugin guest. 498 // Set the AX tree ID of the embedder RFHI, if this is a browser plugin guest.
499 void set_browser_plugin_embedder_ax_tree_id( 499 void set_browser_plugin_embedder_ax_tree_id(
500 AXTreeIDRegistry::AXTreeID ax_tree_id) { 500 ui::AXTreeIDRegistry::AXTreeID ax_tree_id) {
501 browser_plugin_embedder_ax_tree_id_ = ax_tree_id; 501 browser_plugin_embedder_ax_tree_id_ = ax_tree_id;
502 } 502 }
503 503
504 // Send a message to the render process to change text track style settings. 504 // Send a message to the render process to change text track style settings.
505 void SetTextTrackSettings(const FrameMsg_TextTrackSettings_Params& params); 505 void SetTextTrackSettings(const FrameMsg_TextTrackSettings_Params& params);
506 506
507 // Returns a snapshot of the accessibility tree received from the 507 // Returns a snapshot of the accessibility tree received from the
508 // renderer as of the last time an accessibility notification was 508 // renderer as of the last time an accessibility notification was
509 // received. 509 // received.
510 const ui::AXTree* GetAXTreeForTesting(); 510 const ui::AXTree* GetAXTreeForTesting();
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 813
814 void UpdatePermissionsForNavigation( 814 void UpdatePermissionsForNavigation(
815 const CommonNavigationParams& common_params, 815 const CommonNavigationParams& common_params,
816 const RequestNavigationParams& request_params); 816 const RequestNavigationParams& request_params);
817 817
818 // Returns true if the ExecuteJavaScript() API can be used on this host. 818 // Returns true if the ExecuteJavaScript() API can be used on this host.
819 bool CanExecuteJavaScript(); 819 bool CanExecuteJavaScript();
820 820
821 // Map a routing ID from a frame in the same frame tree to a globally 821 // Map a routing ID from a frame in the same frame tree to a globally
822 // unique AXTreeID. 822 // unique AXTreeID.
823 AXTreeIDRegistry::AXTreeID RoutingIDToAXTreeID(int routing_id); 823 ui::AXTreeIDRegistry::AXTreeID RoutingIDToAXTreeID(int routing_id);
824 824
825 // Map a browser plugin instance ID to the AXTreeID of the plugin's 825 // Map a browser plugin instance ID to the AXTreeID of the plugin's
826 // main frame. 826 // main frame.
827 AXTreeIDRegistry::AXTreeID BrowserPluginInstanceIDToAXTreeID(int routing_id); 827 ui::AXTreeIDRegistry::AXTreeID BrowserPluginInstanceIDToAXTreeID(
828 int routing_id);
828 829
829 // Convert the content-layer-specific AXContentNodeData to a general-purpose 830 // Convert the content-layer-specific AXContentNodeData to a general-purpose
830 // AXNodeData structure. 831 // AXNodeData structure.
831 void AXContentNodeDataToAXNodeData(const AXContentNodeData& src, 832 void AXContentNodeDataToAXNodeData(const AXContentNodeData& src,
832 ui::AXNodeData* dst); 833 ui::AXNodeData* dst);
833 834
834 // Convert the content-layer-specific AXContentTreeData to a general-purpose 835 // Convert the content-layer-specific AXContentTreeData to a general-purpose
835 // AXTreeData structure. 836 // AXTreeData structure.
836 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst); 837 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst);
837 838
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 int accessibility_reset_token_; 1048 int accessibility_reset_token_;
1048 1049
1049 // A count of the number of times we needed to reset accessibility, so 1050 // A count of the number of times we needed to reset accessibility, so
1050 // we don't keep trying to reset forever. 1051 // we don't keep trying to reset forever.
1051 int accessibility_reset_count_; 1052 int accessibility_reset_count_;
1052 1053
1053 // The last AXContentTreeData for this frame received from the RenderFrame. 1054 // The last AXContentTreeData for this frame received from the RenderFrame.
1054 AXContentTreeData ax_content_tree_data_; 1055 AXContentTreeData ax_content_tree_data_;
1055 1056
1056 // The AX tree ID of the embedder, if this is a browser plugin guest. 1057 // The AX tree ID of the embedder, if this is a browser plugin guest.
1057 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; 1058 ui::AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_;
1058 1059
1059 // The mapping from callback id to corresponding callback for pending 1060 // The mapping from callback id to corresponding callback for pending
1060 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. 1061 // accessibility tree snapshot calls created by RequestAXTreeSnapshot.
1061 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; 1062 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_;
1062 1063
1063 // Samsung Galaxy Note-specific "smart clip" stylus text getter. 1064 // Samsung Galaxy Note-specific "smart clip" stylus text getter.
1064 std::map<uint32_t, SmartClipCallback> smart_clip_callbacks_; 1065 std::map<uint32_t, SmartClipCallback> smart_clip_callbacks_;
1065 1066
1066 // Callback when an event is received, for testing. 1067 // Callback when an event is received, for testing.
1067 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> 1068 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 1154
1154 // NOTE: This must be the last member. 1155 // NOTE: This must be the last member.
1155 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 1156 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
1156 1157
1157 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 1158 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
1158 }; 1159 };
1159 1160
1160 } // namespace content 1161 } // namespace content
1161 1162
1162 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 1163 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698