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/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 size_t end_offset) { | 1215 size_t end_offset) { |
1216 render_view_host_->OnTextSurroundingSelectionResponse( | 1216 render_view_host_->OnTextSurroundingSelectionResponse( |
1217 content, start_offset, end_offset); | 1217 content, start_offset, end_offset); |
1218 } | 1218 } |
1219 | 1219 |
1220 void RenderFrameHostImpl::OnDidAccessInitialDocument() { | 1220 void RenderFrameHostImpl::OnDidAccessInitialDocument() { |
1221 delegate_->DidAccessInitialDocument(); | 1221 delegate_->DidAccessInitialDocument(); |
1222 } | 1222 } |
1223 | 1223 |
1224 void RenderFrameHostImpl::OnDidDisownOpener() { | 1224 void RenderFrameHostImpl::OnDidDisownOpener() { |
1225 // This message is only sent for top-level frames. TODO(avi): when frame tree | 1225 // This message is only sent for top-level frames for now. |
1226 // mirroring works correctly, add a check here to enforce it. | 1226 // TODO(alexmos): This should eventually support subframe openers as well, |
1227 delegate_->DidDisownOpener(this); | 1227 // and it should allow openers to be updated to another frame (which can |
| 1228 // happen via window.open('','framename')) in addition to being disowned. |
| 1229 |
| 1230 // No action is necessary if the opener has already been cleared. |
| 1231 if (!frame_tree_node_->opener()) |
| 1232 return; |
| 1233 |
| 1234 // Clear our opener so that future cross-process navigations don't have an |
| 1235 // opener assigned. |
| 1236 frame_tree_node_->SetOpener(nullptr); |
| 1237 |
| 1238 // Notify all other RenderFrameHosts and RenderFrameProxies for this frame. |
| 1239 // This is important in case we go back to them, or if another window in |
| 1240 // those processes tries to access window.opener. |
| 1241 frame_tree_node_->render_manager()->DidDisownOpener(this); |
1228 } | 1242 } |
1229 | 1243 |
1230 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { | 1244 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { |
1231 frame_tree_node()->SetFrameName(name); | 1245 frame_tree_node()->SetFrameName(name); |
1232 delegate_->DidChangeName(this, name); | 1246 delegate_->DidChangeName(this, name); |
1233 } | 1247 } |
1234 | 1248 |
1235 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { | 1249 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { |
1236 // Update the RVH's current page ID so that future IPCs from the renderer | 1250 // Update the RVH's current page ID so that future IPCs from the renderer |
1237 // correspond to the new page. | 1251 // correspond to the new page. |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2071 // We may be returning to an existing NavigationEntry that had been granted | 2085 // We may be returning to an existing NavigationEntry that had been granted |
2072 // file access. If this is a different process, we will need to grant the | 2086 // file access. If this is a different process, we will need to grant the |
2073 // access again. The files listed in the page state are validated when they | 2087 // access again. The files listed in the page state are validated when they |
2074 // are received from the renderer to prevent abuse. | 2088 // are received from the renderer to prevent abuse. |
2075 if (request_params.page_state.IsValid()) { | 2089 if (request_params.page_state.IsValid()) { |
2076 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); | 2090 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); |
2077 } | 2091 } |
2078 } | 2092 } |
2079 | 2093 |
2080 } // namespace content | 2094 } // namespace content |
OLD | NEW |