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 |
11 #include <list> | 11 #include <list> |
12 #include <map> | 12 #include <map> |
13 #include <set> | 13 #include <set> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/callback.h" | 17 #include "base/callback.h" |
18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
19 #include "base/gtest_prod_util.h" | 19 #include "base/gtest_prod_util.h" |
20 #include "base/macros.h" | 20 #include "base/macros.h" |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
| 22 #include "base/optional.h" |
22 #include "base/strings/string16.h" | 23 #include "base/strings/string16.h" |
23 #include "base/supports_user_data.h" | 24 #include "base/supports_user_data.h" |
24 #include "base/time/time.h" | 25 #include "base/time/time.h" |
25 #include "build/build_config.h" | 26 #include "build/build_config.h" |
26 #include "content/browser/accessibility/browser_accessibility_manager.h" | 27 #include "content/browser/accessibility/browser_accessibility_manager.h" |
27 #include "content/browser/bad_message.h" | 28 #include "content/browser/bad_message.h" |
28 #include "content/browser/loader/global_routing_id.h" | 29 #include "content/browser/loader/global_routing_id.h" |
29 #include "content/browser/site_instance_impl.h" | 30 #include "content/browser/site_instance_impl.h" |
30 #include "content/browser/webui/web_ui_impl.h" | 31 #include "content/browser/webui/web_ui_impl.h" |
31 #include "content/common/accessibility_mode.h" | 32 #include "content/common/accessibility_mode.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 const base::string16& html)>; | 128 const base::string16& html)>; |
128 | 129 |
129 // An accessibility reset is only allowed to prevent very rare corner cases | 130 // An accessibility reset is only allowed to prevent very rare corner cases |
130 // or race conditions where the browser and renderer get out of sync. If | 131 // or race conditions where the browser and renderer get out of sync. If |
131 // this happens more than this many times, kill the renderer. | 132 // this happens more than this many times, kill the renderer. |
132 static const int kMaxAccessibilityResets = 5; | 133 static const int kMaxAccessibilityResets = 5; |
133 | 134 |
134 static RenderFrameHostImpl* FromID(int process_id, int routing_id); | 135 static RenderFrameHostImpl* FromID(int process_id, int routing_id); |
135 static RenderFrameHostImpl* FromAXTreeID( | 136 static RenderFrameHostImpl* FromAXTreeID( |
136 ui::AXTreeIDRegistry::AXTreeID ax_tree_id); | 137 ui::AXTreeIDRegistry::AXTreeID ax_tree_id); |
| 138 #if defined(OS_ANDROID) |
| 139 static RenderFrameHostImpl* FromOverlayRoutingToken( |
| 140 const base::UnguessableToken& token); |
| 141 #endif |
137 | 142 |
138 ~RenderFrameHostImpl() override; | 143 ~RenderFrameHostImpl() override; |
139 | 144 |
140 // RenderFrameHost | 145 // RenderFrameHost |
141 int GetRoutingID() override; | 146 int GetRoutingID() override; |
142 ui::AXTreeIDRegistry::AXTreeID GetAXTreeID() override; | 147 ui::AXTreeIDRegistry::AXTreeID GetAXTreeID() override; |
| 148 #if defined(OS_ANDROID) |
| 149 const base::UnguessableToken& GetOverlayRoutingToken() override; |
| 150 #endif |
143 SiteInstanceImpl* GetSiteInstance() override; | 151 SiteInstanceImpl* GetSiteInstance() override; |
144 RenderProcessHost* GetProcess() override; | 152 RenderProcessHost* GetProcess() override; |
145 RenderWidgetHostView* GetView() override; | 153 RenderWidgetHostView* GetView() override; |
146 RenderFrameHostImpl* GetParent() override; | 154 RenderFrameHostImpl* GetParent() override; |
147 int GetFrameTreeNodeId() override; | 155 int GetFrameTreeNodeId() override; |
148 const std::string& GetFrameName() override; | 156 const std::string& GetFrameName() override; |
149 bool IsCrossProcessSubframe() override; | 157 bool IsCrossProcessSubframe() override; |
150 const GURL& GetLastCommittedURL() override; | 158 const GURL& GetLastCommittedURL() override; |
151 const url::Origin& GetLastCommittedOrigin() override; | 159 const url::Origin& GetLastCommittedOrigin() override; |
152 gfx::NativeView GetNativeView() override; | 160 gfx::NativeView GetNativeView() override; |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 void OnFocusedNodeChanged(bool is_editable_element, | 787 void OnFocusedNodeChanged(bool is_editable_element, |
780 const gfx::Rect& bounds_in_frame_widget); | 788 const gfx::Rect& bounds_in_frame_widget); |
781 void OnSetHasReceivedUserGesture(); | 789 void OnSetHasReceivedUserGesture(); |
782 | 790 |
783 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 791 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
784 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); | 792 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); |
785 void OnHidePopup(); | 793 void OnHidePopup(); |
786 #endif | 794 #endif |
787 #if defined(OS_ANDROID) | 795 #if defined(OS_ANDROID) |
788 void OnNavigationHandledByEmbedder(); | 796 void OnNavigationHandledByEmbedder(); |
| 797 |
| 798 // Called when the frame would like an overlay routing token. This will |
| 799 // create one if needed. Either way, it will send it to the frame. |
| 800 void OnRequestOverlayRoutingToken(); |
789 #endif | 801 #endif |
790 void OnShowCreatedWindow(int pending_widget_routing_id, | 802 void OnShowCreatedWindow(int pending_widget_routing_id, |
791 WindowOpenDisposition disposition, | 803 WindowOpenDisposition disposition, |
792 const gfx::Rect& initial_rect, | 804 const gfx::Rect& initial_rect, |
793 bool user_gesture); | 805 bool user_gesture); |
794 | 806 |
795 // Registers Mojo interfaces that this frame host makes available. | 807 // Registers Mojo interfaces that this frame host makes available. |
796 void RegisterMojoInterfaces(); | 808 void RegisterMojoInterfaces(); |
797 | 809 |
798 // Resets any waiting state of this RenderFrameHost that is no longer | 810 // Resets any waiting state of this RenderFrameHost that is no longer |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 | 1169 |
1158 // A bitwise OR of bindings types that have been enabled for this RenderFrame. | 1170 // A bitwise OR of bindings types that have been enabled for this RenderFrame. |
1159 // See BindingsPolicy for details. | 1171 // See BindingsPolicy for details. |
1160 int enabled_bindings_ = 0; | 1172 int enabled_bindings_ = 0; |
1161 | 1173 |
1162 // Tracks the feature policy which has been set on this frame. | 1174 // Tracks the feature policy which has been set on this frame. |
1163 std::unique_ptr<FeaturePolicy> feature_policy_; | 1175 std::unique_ptr<FeaturePolicy> feature_policy_; |
1164 | 1176 |
1165 #if defined(OS_ANDROID) | 1177 #if defined(OS_ANDROID) |
1166 std::unique_ptr<service_manager::InterfaceProvider> java_interfaces_; | 1178 std::unique_ptr<service_manager::InterfaceProvider> java_interfaces_; |
| 1179 |
| 1180 // IPC-friendly token that represents this host for AndroidOverlays, if we |
| 1181 // have created one yet. |
| 1182 base::Optional<base::UnguessableToken> overlay_routing_token_; |
1167 #endif | 1183 #endif |
1168 | 1184 |
1169 // NOTE: This must be the last member. | 1185 // NOTE: This must be the last member. |
1170 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1186 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
1171 | 1187 |
1172 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1188 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
1173 }; | 1189 }; |
1174 | 1190 |
1175 } // namespace content | 1191 } // namespace content |
1176 | 1192 |
1177 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1193 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |