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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 size_t end_offset) { | 1205 size_t end_offset) { |
1206 render_view_host_->OnTextSurroundingSelectionResponse( | 1206 render_view_host_->OnTextSurroundingSelectionResponse( |
1207 content, start_offset, end_offset); | 1207 content, start_offset, end_offset); |
1208 } | 1208 } |
1209 | 1209 |
1210 void RenderFrameHostImpl::OnDidAccessInitialDocument() { | 1210 void RenderFrameHostImpl::OnDidAccessInitialDocument() { |
1211 delegate_->DidAccessInitialDocument(); | 1211 delegate_->DidAccessInitialDocument(); |
1212 } | 1212 } |
1213 | 1213 |
1214 void RenderFrameHostImpl::OnDidDisownOpener() { | 1214 void RenderFrameHostImpl::OnDidDisownOpener() { |
1215 // This message is only sent for top-level frames. TODO(avi): when frame tree | 1215 // This message is only sent for top-level frames for now. |
1216 // mirroring works correctly, add a check here to enforce it. | 1216 // TODO(alexmos): This should eventually support subframe openers as well, |
1217 delegate_->DidDisownOpener(this); | 1217 // and it should allow openers to be updated to another frame (which can |
| 1218 // happen via window.open('','framename')) in addition to being disowned. |
| 1219 |
| 1220 // No action is necessary if the opener has already been cleared. |
| 1221 if (!frame_tree_node_->opener()) |
| 1222 return; |
| 1223 |
| 1224 // Clear our opener so that future cross-process navigations don't have an |
| 1225 // opener assigned. |
| 1226 frame_tree_node_->SetOpener(nullptr); |
| 1227 |
| 1228 // Notify all other RenderFrameHosts and RenderFrameProxies for this frame. |
| 1229 // This is important in case we go back to them, or if another window in |
| 1230 // those processes tries to access window.opener. |
| 1231 frame_tree_node_->render_manager()->DidDisownOpener(this); |
1218 } | 1232 } |
1219 | 1233 |
1220 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { | 1234 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { |
1221 frame_tree_node()->SetFrameName(name); | 1235 frame_tree_node()->SetFrameName(name); |
1222 delegate_->DidChangeName(this, name); | 1236 delegate_->DidChangeName(this, name); |
1223 } | 1237 } |
1224 | 1238 |
1225 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { | 1239 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { |
1226 // Update the RVH's current page ID so that future IPCs from the renderer | 1240 // Update the RVH's current page ID so that future IPCs from the renderer |
1227 // correspond to the new page. | 1241 // correspond to the new page. |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2061 // We may be returning to an existing NavigationEntry that had been granted | 2075 // We may be returning to an existing NavigationEntry that had been granted |
2062 // file access. If this is a different process, we will need to grant the | 2076 // file access. If this is a different process, we will need to grant the |
2063 // access again. The files listed in the page state are validated when they | 2077 // access again. The files listed in the page state are validated when they |
2064 // are received from the renderer to prevent abuse. | 2078 // are received from the renderer to prevent abuse. |
2065 if (request_params.page_state.IsValid()) { | 2079 if (request_params.page_state.IsValid()) { |
2066 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); | 2080 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); |
2067 } | 2081 } |
2068 } | 2082 } |
2069 | 2083 |
2070 } // namespace content | 2084 } // namespace content |
OLD | NEW |