| 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 #include "content/browser/frame_host/frame_tree.h" | 5 #include "content/browser/frame_host/frame_tree.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 RenderViewHostDelegate* render_view_delegate, | 89 RenderViewHostDelegate* render_view_delegate, |
| 90 RenderWidgetHostDelegate* render_widget_delegate, | 90 RenderWidgetHostDelegate* render_widget_delegate, |
| 91 RenderFrameHostManager::Delegate* manager_delegate) | 91 RenderFrameHostManager::Delegate* manager_delegate) |
| 92 : render_frame_delegate_(render_frame_delegate), | 92 : render_frame_delegate_(render_frame_delegate), |
| 93 render_view_delegate_(render_view_delegate), | 93 render_view_delegate_(render_view_delegate), |
| 94 render_widget_delegate_(render_widget_delegate), | 94 render_widget_delegate_(render_widget_delegate), |
| 95 manager_delegate_(manager_delegate), | 95 manager_delegate_(manager_delegate), |
| 96 root_(new FrameTreeNode(this, | 96 root_(new FrameTreeNode(this, |
| 97 navigator, | 97 navigator, |
| 98 render_frame_delegate, | 98 render_frame_delegate, |
| 99 render_view_delegate, | |
| 100 render_widget_delegate, | 99 render_widget_delegate, |
| 101 manager_delegate, | 100 manager_delegate, |
| 102 // The top-level frame must always be in a | 101 // The top-level frame must always be in a |
| 103 // document scope. | 102 // document scope. |
| 104 blink::WebTreeScopeType::Document, | 103 blink::WebTreeScopeType::Document, |
| 105 std::string(), | 104 std::string(), |
| 106 std::string(), | 105 std::string(), |
| 107 blink::WebFrameOwnerProperties())), | 106 blink::WebFrameOwnerProperties())), |
| 108 focused_frame_tree_node_id_(-1), | 107 focused_frame_tree_node_id_(-1), |
| 109 load_progress_(0.0) {} | 108 load_progress_(0.0) {} |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // it is in the same SiteInstance as the parent frame. Ensure that the process | 179 // it is in the same SiteInstance as the parent frame. Ensure that the process |
| 181 // which requested a child frame to be added is the same as the process of the | 180 // which requested a child frame to be added is the same as the process of the |
| 182 // parent node. | 181 // parent node. |
| 183 if (parent->current_frame_host()->GetProcess()->GetID() != process_id) | 182 if (parent->current_frame_host()->GetProcess()->GetID() != process_id) |
| 184 return false; | 183 return false; |
| 185 | 184 |
| 186 // AddChild is what creates the RenderFrameHost. | 185 // AddChild is what creates the RenderFrameHost. |
| 187 FrameTreeNode* added_node = parent->AddChild( | 186 FrameTreeNode* added_node = parent->AddChild( |
| 188 base::WrapUnique(new FrameTreeNode( | 187 base::WrapUnique(new FrameTreeNode( |
| 189 this, parent->navigator(), render_frame_delegate_, | 188 this, parent->navigator(), render_frame_delegate_, |
| 190 render_view_delegate_, render_widget_delegate_, manager_delegate_, | 189 render_widget_delegate_, manager_delegate_, scope, frame_name, |
| 191 scope, frame_name, frame_unique_name, frame_owner_properties)), | 190 frame_unique_name, frame_owner_properties)), |
| 192 process_id, new_routing_id); | 191 process_id, new_routing_id); |
| 193 | 192 |
| 194 // Set sandbox flags and make them effective immediately, since initial | 193 // Set sandbox flags and make them effective immediately, since initial |
| 195 // sandbox flags should apply to the initial empty document in the frame. | 194 // sandbox flags should apply to the initial empty document in the frame. |
| 196 added_node->SetPendingSandboxFlags(sandbox_flags); | 195 added_node->SetPendingSandboxFlags(sandbox_flags); |
| 197 added_node->CommitPendingSandboxFlags(); | 196 added_node->CommitPendingSandboxFlags(); |
| 198 | 197 |
| 199 // Now that the new node is part of the FrameTree and has a RenderFrameHost, | 198 // Now that the new node is part of the FrameTree and has a RenderFrameHost, |
| 200 // we can announce the creation of the initial RenderFrame which already | 199 // we can announce the creation of the initial RenderFrame which already |
| 201 // exists in the renderer process. | 200 // exists in the renderer process. |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 // This is only used to set page-level focus in cross-process subframes, and | 462 // This is only used to set page-level focus in cross-process subframes, and |
| 464 // requests to set focus in main frame's SiteInstance are ignored. | 463 // requests to set focus in main frame's SiteInstance are ignored. |
| 465 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { | 464 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { |
| 466 RenderFrameProxyHost* proxy = | 465 RenderFrameProxyHost* proxy = |
| 467 root_manager->GetRenderFrameProxyHost(instance); | 466 root_manager->GetRenderFrameProxyHost(instance); |
| 468 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); | 467 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); |
| 469 } | 468 } |
| 470 } | 469 } |
| 471 | 470 |
| 472 } // namespace content | 471 } // namespace content |
| OLD | NEW |