OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/browser/frame_host/render_frame_proxy_host.h" | 5 #include "content/browser/frame_host/render_frame_proxy_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "content/browser/bad_message.h" | 10 #include "content/browser/bad_message.h" |
11 #include "content/browser/frame_host/cross_process_frame_connector.h" | 11 #include "content/browser/frame_host/cross_process_frame_connector.h" |
12 #include "content/browser/frame_host/frame_tree.h" | 12 #include "content/browser/frame_host/frame_tree.h" |
13 #include "content/browser/frame_host/frame_tree_node.h" | 13 #include "content/browser/frame_host/frame_tree_node.h" |
14 #include "content/browser/frame_host/navigator.h" | 14 #include "content/browser/frame_host/navigator.h" |
15 #include "content/browser/frame_host/render_frame_host_delegate.h" | 15 #include "content/browser/frame_host/render_frame_host_delegate.h" |
16 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 16 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
17 #include "content/browser/message_port_message_filter.h" | 17 #include "content/browser/message_port_message_filter.h" |
18 #include "content/browser/renderer_host/render_view_host_impl.h" | 18 #include "content/browser/renderer_host/render_view_host_impl.h" |
19 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 19 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
20 #include "content/browser/site_instance_impl.h" | 20 #include "content/browser/site_instance_impl.h" |
21 #include "content/common/frame_messages.h" | 21 #include "content/common/frame_messages.h" |
| 22 #include "content/common/frame_owner_properties.h" |
22 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
23 #include "ipc/ipc_message.h" | 24 #include "ipc/ipc_message.h" |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
29 // The (process id, routing id) pair that identifies one RenderFrameProxy. | 30 // The (process id, routing id) pair that identifies one RenderFrameProxy. |
30 typedef std::pair<int32_t, int32_t> RenderFrameProxyHostID; | 31 typedef std::pair<int32_t, int32_t> RenderFrameProxyHostID; |
31 typedef base::hash_map<RenderFrameProxyHostID, RenderFrameProxyHost*> | 32 typedef base::hash_map<RenderFrameProxyHostID, RenderFrameProxyHost*> |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 ->current_replication_state())); | 194 ->current_replication_state())); |
194 | 195 |
195 render_frame_proxy_created_ = true; | 196 render_frame_proxy_created_ = true; |
196 | 197 |
197 // For subframes, initialize the proxy's WebFrameOwnerProperties only if they | 198 // For subframes, initialize the proxy's WebFrameOwnerProperties only if they |
198 // differ from default values. | 199 // differ from default values. |
199 bool should_send_properties = frame_tree_node_->frame_owner_properties() != | 200 bool should_send_properties = frame_tree_node_->frame_owner_properties() != |
200 blink::WebFrameOwnerProperties(); | 201 blink::WebFrameOwnerProperties(); |
201 if (frame_tree_node_->parent() && should_send_properties) { | 202 if (frame_tree_node_->parent() && should_send_properties) { |
202 Send(new FrameMsg_SetFrameOwnerProperties( | 203 Send(new FrameMsg_SetFrameOwnerProperties( |
203 routing_id_, frame_tree_node_->frame_owner_properties())); | 204 routing_id_, |
| 205 FrameOwnerProperties(frame_tree_node_->frame_owner_properties()))); |
204 } | 206 } |
205 | 207 |
206 return true; | 208 return true; |
207 } | 209 } |
208 | 210 |
209 void RenderFrameProxyHost::UpdateOpener() { | 211 void RenderFrameProxyHost::UpdateOpener() { |
210 // Another frame in this proxy's SiteInstance may reach the new opener by | 212 // Another frame in this proxy's SiteInstance may reach the new opener by |
211 // first reaching this proxy and then referencing its window.opener. Ensure | 213 // first reaching this proxy and then referencing its window.opener. Ensure |
212 // the new opener's proxy exists in this case. | 214 // the new opener's proxy exists in this case. |
213 if (frame_tree_node_->opener()) { | 215 if (frame_tree_node_->opener()) { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type, | 370 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type, |
369 source_proxy_routing_id)); | 371 source_proxy_routing_id)); |
370 } | 372 } |
371 | 373 |
372 void RenderFrameProxyHost::OnFrameFocused() { | 374 void RenderFrameProxyHost::OnFrameFocused() { |
373 frame_tree_node_->frame_tree()->SetFocusedFrame(frame_tree_node_, | 375 frame_tree_node_->frame_tree()->SetFocusedFrame(frame_tree_node_, |
374 GetSiteInstance()); | 376 GetSiteInstance()); |
375 } | 377 } |
376 | 378 |
377 } // namespace content | 379 } // namespace content |
OLD | NEW |