| OLD | NEW |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 base::Callback<void( | 120 base::Callback<void( |
| 121 const ui::AXTreeUpdate&)>; | 121 const ui::AXTreeUpdate&)>; |
| 122 | 122 |
| 123 // An accessibility reset is only allowed to prevent very rare corner cases | 123 // An accessibility reset is only allowed to prevent very rare corner cases |
| 124 // or race conditions where the browser and renderer get out of sync. If | 124 // or race conditions where the browser and renderer get out of sync. If |
| 125 // this happens more than this many times, kill the renderer. | 125 // this happens more than this many times, kill the renderer. |
| 126 static const int kMaxAccessibilityResets = 5; | 126 static const int kMaxAccessibilityResets = 5; |
| 127 | 127 |
| 128 static RenderFrameHostImpl* FromID(int process_id, int routing_id); | 128 static RenderFrameHostImpl* FromID(int process_id, int routing_id); |
| 129 static RenderFrameHostImpl* FromAXTreeID( | 129 static RenderFrameHostImpl* FromAXTreeID( |
| 130 AXTreeIDRegistry::AXTreeID ax_tree_id); | 130 ui::AXTreeIDRegistry::AXTreeID ax_tree_id); |
| 131 | 131 |
| 132 ~RenderFrameHostImpl() override; | 132 ~RenderFrameHostImpl() override; |
| 133 | 133 |
| 134 // RenderFrameHost | 134 // RenderFrameHost |
| 135 int GetRoutingID() override; | 135 int GetRoutingID() override; |
| 136 AXTreeIDRegistry::AXTreeID GetAXTreeID() override; | 136 ui::AXTreeIDRegistry::AXTreeID GetAXTreeID() override; |
| 137 SiteInstanceImpl* GetSiteInstance() override; | 137 SiteInstanceImpl* GetSiteInstance() override; |
| 138 RenderProcessHost* GetProcess() override; | 138 RenderProcessHost* GetProcess() override; |
| 139 RenderWidgetHostView* GetView() override; | 139 RenderWidgetHostView* GetView() override; |
| 140 RenderFrameHostImpl* GetParent() override; | 140 RenderFrameHostImpl* GetParent() override; |
| 141 int GetFrameTreeNodeId() override; | 141 int GetFrameTreeNodeId() override; |
| 142 const std::string& GetFrameName() override; | 142 const std::string& GetFrameName() override; |
| 143 bool IsCrossProcessSubframe() override; | 143 bool IsCrossProcessSubframe() override; |
| 144 const GURL& GetLastCommittedURL() override; | 144 const GURL& GetLastCommittedURL() override; |
| 145 const url::Origin& GetLastCommittedOrigin() override; | 145 const url::Origin& GetLastCommittedOrigin() override; |
| 146 gfx::NativeView GetNativeView() override; | 146 gfx::NativeView GetNativeView() override; |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 const base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)>& | 492 const base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)>& |
| 493 callback); | 493 callback); |
| 494 | 494 |
| 495 // Called when the metadata about the accessibility tree for this frame | 495 // Called when the metadata about the accessibility tree for this frame |
| 496 // changes due to a browser-side change, as opposed to due to an IPC from | 496 // changes due to a browser-side change, as opposed to due to an IPC from |
| 497 // a renderer. | 497 // a renderer. |
| 498 void UpdateAXTreeData(); | 498 void UpdateAXTreeData(); |
| 499 | 499 |
| 500 // Set the AX tree ID of the embedder RFHI, if this is a browser plugin guest. | 500 // Set the AX tree ID of the embedder RFHI, if this is a browser plugin guest. |
| 501 void set_browser_plugin_embedder_ax_tree_id( | 501 void set_browser_plugin_embedder_ax_tree_id( |
| 502 AXTreeIDRegistry::AXTreeID ax_tree_id) { | 502 ui::AXTreeIDRegistry::AXTreeID ax_tree_id) { |
| 503 browser_plugin_embedder_ax_tree_id_ = ax_tree_id; | 503 browser_plugin_embedder_ax_tree_id_ = ax_tree_id; |
| 504 } | 504 } |
| 505 | 505 |
| 506 // Send a message to the render process to change text track style settings. | 506 // Send a message to the render process to change text track style settings. |
| 507 void SetTextTrackSettings(const FrameMsg_TextTrackSettings_Params& params); | 507 void SetTextTrackSettings(const FrameMsg_TextTrackSettings_Params& params); |
| 508 | 508 |
| 509 // Returns a snapshot of the accessibility tree received from the | 509 // Returns a snapshot of the accessibility tree received from the |
| 510 // renderer as of the last time an accessibility notification was | 510 // renderer as of the last time an accessibility notification was |
| 511 // received. | 511 // received. |
| 512 const ui::AXTree* GetAXTreeForTesting(); | 512 const ui::AXTree* GetAXTreeForTesting(); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 | 806 |
| 807 void UpdatePermissionsForNavigation( | 807 void UpdatePermissionsForNavigation( |
| 808 const CommonNavigationParams& common_params, | 808 const CommonNavigationParams& common_params, |
| 809 const RequestNavigationParams& request_params); | 809 const RequestNavigationParams& request_params); |
| 810 | 810 |
| 811 // Returns true if the ExecuteJavaScript() API can be used on this host. | 811 // Returns true if the ExecuteJavaScript() API can be used on this host. |
| 812 bool CanExecuteJavaScript(); | 812 bool CanExecuteJavaScript(); |
| 813 | 813 |
| 814 // Map a routing ID from a frame in the same frame tree to a globally | 814 // Map a routing ID from a frame in the same frame tree to a globally |
| 815 // unique AXTreeID. | 815 // unique AXTreeID. |
| 816 AXTreeIDRegistry::AXTreeID RoutingIDToAXTreeID(int routing_id); | 816 ui::AXTreeIDRegistry::AXTreeID RoutingIDToAXTreeID(int routing_id); |
| 817 | 817 |
| 818 // Map a browser plugin instance ID to the AXTreeID of the plugin's | 818 // Map a browser plugin instance ID to the AXTreeID of the plugin's |
| 819 // main frame. | 819 // main frame. |
| 820 AXTreeIDRegistry::AXTreeID BrowserPluginInstanceIDToAXTreeID(int routing_id); | 820 ui::AXTreeIDRegistry::AXTreeID BrowserPluginInstanceIDToAXTreeID( |
| 821 int routing_id); |
| 821 | 822 |
| 822 // Convert the content-layer-specific AXContentNodeData to a general-purpose | 823 // Convert the content-layer-specific AXContentNodeData to a general-purpose |
| 823 // AXNodeData structure. | 824 // AXNodeData structure. |
| 824 void AXContentNodeDataToAXNodeData(const AXContentNodeData& src, | 825 void AXContentNodeDataToAXNodeData(const AXContentNodeData& src, |
| 825 ui::AXNodeData* dst); | 826 ui::AXNodeData* dst); |
| 826 | 827 |
| 827 // Convert the content-layer-specific AXContentTreeData to a general-purpose | 828 // Convert the content-layer-specific AXContentTreeData to a general-purpose |
| 828 // AXTreeData structure. | 829 // AXTreeData structure. |
| 829 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst); | 830 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst); |
| 830 | 831 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 int accessibility_reset_token_; | 1047 int accessibility_reset_token_; |
| 1047 | 1048 |
| 1048 // A count of the number of times we needed to reset accessibility, so | 1049 // A count of the number of times we needed to reset accessibility, so |
| 1049 // we don't keep trying to reset forever. | 1050 // we don't keep trying to reset forever. |
| 1050 int accessibility_reset_count_; | 1051 int accessibility_reset_count_; |
| 1051 | 1052 |
| 1052 // The last AXContentTreeData for this frame received from the RenderFrame. | 1053 // The last AXContentTreeData for this frame received from the RenderFrame. |
| 1053 AXContentTreeData ax_content_tree_data_; | 1054 AXContentTreeData ax_content_tree_data_; |
| 1054 | 1055 |
| 1055 // The AX tree ID of the embedder, if this is a browser plugin guest. | 1056 // The AX tree ID of the embedder, if this is a browser plugin guest. |
| 1056 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; | 1057 ui::AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; |
| 1057 | 1058 |
| 1058 // The mapping from callback id to corresponding callback for pending | 1059 // The mapping from callback id to corresponding callback for pending |
| 1059 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. | 1060 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. |
| 1060 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; | 1061 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; |
| 1061 | 1062 |
| 1062 // Callback when an event is received, for testing. | 1063 // Callback when an event is received, for testing. |
| 1063 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> | 1064 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> |
| 1064 accessibility_testing_callback_; | 1065 accessibility_testing_callback_; |
| 1065 // The most recently received accessibility tree - for testing only. | 1066 // The most recently received accessibility tree - for testing only. |
| 1066 std::unique_ptr<ui::AXTree> ax_tree_for_testing_; | 1067 std::unique_ptr<ui::AXTree> ax_tree_for_testing_; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 | 1142 |
| 1142 // NOTE: This must be the last member. | 1143 // NOTE: This must be the last member. |
| 1143 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1144 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 1144 | 1145 |
| 1145 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1146 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 1146 }; | 1147 }; |
| 1147 | 1148 |
| 1148 } // namespace content | 1149 } // namespace content |
| 1149 | 1150 |
| 1150 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1151 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |