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" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 Send(new FrameMsg_NewFrameProxy(routing_id_, | 186 Send(new FrameMsg_NewFrameProxy(routing_id_, |
187 frame_tree_node_->frame_tree() | 187 frame_tree_node_->frame_tree() |
188 ->GetRenderViewHost(site_instance_.get()) | 188 ->GetRenderViewHost(site_instance_.get()) |
189 ->GetRoutingID(), | 189 ->GetRoutingID(), |
190 opener_routing_id, | 190 opener_routing_id, |
191 parent_routing_id, | 191 parent_routing_id, |
192 frame_tree_node_ | 192 frame_tree_node_ |
193 ->current_replication_state())); | 193 ->current_replication_state())); |
194 | 194 |
195 render_frame_proxy_created_ = true; | 195 render_frame_proxy_created_ = true; |
| 196 |
| 197 // For subframes, initialize the proxy's WebFrameOwnerProperties only if they |
| 198 // differ from default values. |
| 199 bool should_send_properties = frame_tree_node_->frame_owner_properties() != |
| 200 blink::WebFrameOwnerProperties(); |
| 201 if (frame_tree_node_->parent() && should_send_properties) { |
| 202 Send(new FrameMsg_SetFrameOwnerProperties( |
| 203 routing_id_, frame_tree_node_->frame_owner_properties())); |
| 204 } |
| 205 |
196 return true; | 206 return true; |
197 } | 207 } |
198 | 208 |
199 void RenderFrameProxyHost::UpdateOpener() { | 209 void RenderFrameProxyHost::UpdateOpener() { |
200 // Another frame in this proxy's SiteInstance may reach the new opener by | 210 // Another frame in this proxy's SiteInstance may reach the new opener by |
201 // first reaching this proxy and then referencing its window.opener. Ensure | 211 // first reaching this proxy and then referencing its window.opener. Ensure |
202 // the new opener's proxy exists in this case. | 212 // the new opener's proxy exists in this case. |
203 if (frame_tree_node_->opener()) { | 213 if (frame_tree_node_->opener()) { |
204 frame_tree_node_->opener()->render_manager()->CreateOpenerProxies( | 214 frame_tree_node_->opener()->render_manager()->CreateOpenerProxies( |
205 GetSiteInstance(), frame_tree_node_); | 215 GetSiteInstance(), frame_tree_node_); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type, | 367 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type, |
358 source_proxy_routing_id)); | 368 source_proxy_routing_id)); |
359 } | 369 } |
360 | 370 |
361 void RenderFrameProxyHost::OnFrameFocused() { | 371 void RenderFrameProxyHost::OnFrameFocused() { |
362 frame_tree_node_->frame_tree()->SetFocusedFrame(frame_tree_node_, | 372 frame_tree_node_->frame_tree()->SetFocusedFrame(frame_tree_node_, |
363 GetSiteInstance()); | 373 GetSiteInstance()); |
364 } | 374 } |
365 | 375 |
366 } // namespace content | 376 } // namespace content |
OLD | NEW |