| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 using SmartClipCallback = base::Callback<void(const base::string16& text, | 124 using SmartClipCallback = base::Callback<void(const base::string16& text, |
| 125 const base::string16& html)>; | 125 const base::string16& html)>; |
| 126 | 126 |
| 127 // An accessibility reset is only allowed to prevent very rare corner cases | 127 // An accessibility reset is only allowed to prevent very rare corner cases |
| 128 // or race conditions where the browser and renderer get out of sync. If | 128 // or race conditions where the browser and renderer get out of sync. If |
| 129 // this happens more than this many times, kill the renderer. | 129 // this happens more than this many times, kill the renderer. |
| 130 static const int kMaxAccessibilityResets = 5; | 130 static const int kMaxAccessibilityResets = 5; |
| 131 | 131 |
| 132 static RenderFrameHostImpl* FromID(int process_id, int routing_id); | 132 static RenderFrameHostImpl* FromID(int process_id, int routing_id); |
| 133 static RenderFrameHostImpl* FromAXTreeID( | 133 static RenderFrameHostImpl* FromAXTreeID( |
| 134 AXTreeIDRegistry::AXTreeID ax_tree_id); | 134 ui::AXTreeIDRegistry::AXTreeID ax_tree_id); |
| 135 | 135 |
| 136 ~RenderFrameHostImpl() override; | 136 ~RenderFrameHostImpl() override; |
| 137 | 137 |
| 138 // RenderFrameHost | 138 // RenderFrameHost |
| 139 int GetRoutingID() override; | 139 int GetRoutingID() override; |
| 140 AXTreeIDRegistry::AXTreeID GetAXTreeID() override; | 140 ui::AXTreeIDRegistry::AXTreeID GetAXTreeID() override; |
| 141 SiteInstanceImpl* GetSiteInstance() override; | 141 SiteInstanceImpl* GetSiteInstance() override; |
| 142 RenderProcessHost* GetProcess() override; | 142 RenderProcessHost* GetProcess() override; |
| 143 RenderWidgetHostView* GetView() override; | 143 RenderWidgetHostView* GetView() override; |
| 144 RenderFrameHostImpl* GetParent() override; | 144 RenderFrameHostImpl* GetParent() override; |
| 145 int GetFrameTreeNodeId() override; | 145 int GetFrameTreeNodeId() override; |
| 146 const std::string& GetFrameName() override; | 146 const std::string& GetFrameName() override; |
| 147 bool IsCrossProcessSubframe() override; | 147 bool IsCrossProcessSubframe() override; |
| 148 const GURL& GetLastCommittedURL() override; | 148 const GURL& GetLastCommittedURL() override; |
| 149 const url::Origin& GetLastCommittedOrigin() override; | 149 const url::Origin& GetLastCommittedOrigin() override; |
| 150 gfx::NativeView GetNativeView() override; | 150 gfx::NativeView GetNativeView() override; |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 const base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)>& | 496 const base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)>& |
| 497 callback); | 497 callback); |
| 498 | 498 |
| 499 // Called when the metadata about the accessibility tree for this frame | 499 // Called when the metadata about the accessibility tree for this frame |
| 500 // changes due to a browser-side change, as opposed to due to an IPC from | 500 // changes due to a browser-side change, as opposed to due to an IPC from |
| 501 // a renderer. | 501 // a renderer. |
| 502 void UpdateAXTreeData(); | 502 void UpdateAXTreeData(); |
| 503 | 503 |
| 504 // Set the AX tree ID of the embedder RFHI, if this is a browser plugin guest. | 504 // Set the AX tree ID of the embedder RFHI, if this is a browser plugin guest. |
| 505 void set_browser_plugin_embedder_ax_tree_id( | 505 void set_browser_plugin_embedder_ax_tree_id( |
| 506 AXTreeIDRegistry::AXTreeID ax_tree_id) { | 506 ui::AXTreeIDRegistry::AXTreeID ax_tree_id) { |
| 507 browser_plugin_embedder_ax_tree_id_ = ax_tree_id; | 507 browser_plugin_embedder_ax_tree_id_ = ax_tree_id; |
| 508 } | 508 } |
| 509 | 509 |
| 510 // Send a message to the render process to change text track style settings. | 510 // Send a message to the render process to change text track style settings. |
| 511 void SetTextTrackSettings(const FrameMsg_TextTrackSettings_Params& params); | 511 void SetTextTrackSettings(const FrameMsg_TextTrackSettings_Params& params); |
| 512 | 512 |
| 513 // Returns a snapshot of the accessibility tree received from the | 513 // Returns a snapshot of the accessibility tree received from the |
| 514 // renderer as of the last time an accessibility notification was | 514 // renderer as of the last time an accessibility notification was |
| 515 // received. | 515 // received. |
| 516 const ui::AXTree* GetAXTreeForTesting(); | 516 const ui::AXTree* GetAXTreeForTesting(); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 | 822 |
| 823 void UpdatePermissionsForNavigation( | 823 void UpdatePermissionsForNavigation( |
| 824 const CommonNavigationParams& common_params, | 824 const CommonNavigationParams& common_params, |
| 825 const RequestNavigationParams& request_params); | 825 const RequestNavigationParams& request_params); |
| 826 | 826 |
| 827 // Returns true if the ExecuteJavaScript() API can be used on this host. | 827 // Returns true if the ExecuteJavaScript() API can be used on this host. |
| 828 bool CanExecuteJavaScript(); | 828 bool CanExecuteJavaScript(); |
| 829 | 829 |
| 830 // Map a routing ID from a frame in the same frame tree to a globally | 830 // Map a routing ID from a frame in the same frame tree to a globally |
| 831 // unique AXTreeID. | 831 // unique AXTreeID. |
| 832 AXTreeIDRegistry::AXTreeID RoutingIDToAXTreeID(int routing_id); | 832 ui::AXTreeIDRegistry::AXTreeID RoutingIDToAXTreeID(int routing_id); |
| 833 | 833 |
| 834 // Map a browser plugin instance ID to the AXTreeID of the plugin's | 834 // Map a browser plugin instance ID to the AXTreeID of the plugin's |
| 835 // main frame. | 835 // main frame. |
| 836 AXTreeIDRegistry::AXTreeID BrowserPluginInstanceIDToAXTreeID(int routing_id); | 836 ui::AXTreeIDRegistry::AXTreeID BrowserPluginInstanceIDToAXTreeID( |
| 837 int routing_id); |
| 837 | 838 |
| 838 // Convert the content-layer-specific AXContentNodeData to a general-purpose | 839 // Convert the content-layer-specific AXContentNodeData to a general-purpose |
| 839 // AXNodeData structure. | 840 // AXNodeData structure. |
| 840 void AXContentNodeDataToAXNodeData(const AXContentNodeData& src, | 841 void AXContentNodeDataToAXNodeData(const AXContentNodeData& src, |
| 841 ui::AXNodeData* dst); | 842 ui::AXNodeData* dst); |
| 842 | 843 |
| 843 // Convert the content-layer-specific AXContentTreeData to a general-purpose | 844 // Convert the content-layer-specific AXContentTreeData to a general-purpose |
| 844 // AXTreeData structure. | 845 // AXTreeData structure. |
| 845 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst); | 846 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst); |
| 846 | 847 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 int accessibility_reset_token_; | 1063 int accessibility_reset_token_; |
| 1063 | 1064 |
| 1064 // A count of the number of times we needed to reset accessibility, so | 1065 // A count of the number of times we needed to reset accessibility, so |
| 1065 // we don't keep trying to reset forever. | 1066 // we don't keep trying to reset forever. |
| 1066 int accessibility_reset_count_; | 1067 int accessibility_reset_count_; |
| 1067 | 1068 |
| 1068 // The last AXContentTreeData for this frame received from the RenderFrame. | 1069 // The last AXContentTreeData for this frame received from the RenderFrame. |
| 1069 AXContentTreeData ax_content_tree_data_; | 1070 AXContentTreeData ax_content_tree_data_; |
| 1070 | 1071 |
| 1071 // The AX tree ID of the embedder, if this is a browser plugin guest. | 1072 // The AX tree ID of the embedder, if this is a browser plugin guest. |
| 1072 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; | 1073 ui::AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; |
| 1073 | 1074 |
| 1074 // The mapping from callback id to corresponding callback for pending | 1075 // The mapping from callback id to corresponding callback for pending |
| 1075 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. | 1076 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. |
| 1076 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; | 1077 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; |
| 1077 | 1078 |
| 1078 // Samsung Galaxy Note-specific "smart clip" stylus text getter. | 1079 // Samsung Galaxy Note-specific "smart clip" stylus text getter. |
| 1079 std::map<uint32_t, SmartClipCallback> smart_clip_callbacks_; | 1080 std::map<uint32_t, SmartClipCallback> smart_clip_callbacks_; |
| 1080 | 1081 |
| 1081 // Callback when an event is received, for testing. | 1082 // Callback when an event is received, for testing. |
| 1082 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> | 1083 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 | 1169 |
| 1169 // NOTE: This must be the last member. | 1170 // NOTE: This must be the last member. |
| 1170 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1171 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 1171 | 1172 |
| 1172 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1173 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 1173 }; | 1174 }; |
| 1174 | 1175 |
| 1175 } // namespace content | 1176 } // namespace content |
| 1176 | 1177 |
| 1177 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1178 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |