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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 OnJavaScriptExecuteResponse) | 362 OnJavaScriptExecuteResponse) |
363 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, | 363 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, |
364 OnVisualStateResponse) | 364 OnVisualStateResponse) |
365 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, | 365 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, |
366 OnRunJavaScriptMessage) | 366 OnRunJavaScriptMessage) |
367 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, | 367 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, |
368 OnRunBeforeUnloadConfirm) | 368 OnRunBeforeUnloadConfirm) |
369 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, | 369 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, |
370 OnDidAccessInitialDocument) | 370 OnDidAccessInitialDocument) |
371 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) | 371 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) |
| 372 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeName, OnDidChangeName) |
372 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAssignPageId, OnDidAssignPageId) | 373 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAssignPageId, OnDidAssignPageId) |
373 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags, | 374 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags, |
374 OnDidChangeSandboxFlags) | 375 OnDidChangeSandboxFlags) |
375 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) | 376 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) |
376 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) | 377 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) |
377 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, | 378 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, |
378 OnBeginNavigation) | 379 OnBeginNavigation) |
379 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad) | 380 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad) |
380 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, | 381 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, |
381 OnTextSurroundingSelectionResponse) | 382 OnTextSurroundingSelectionResponse) |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 void RenderFrameHostImpl::OnDidAccessInitialDocument() { | 1187 void RenderFrameHostImpl::OnDidAccessInitialDocument() { |
1187 delegate_->DidAccessInitialDocument(); | 1188 delegate_->DidAccessInitialDocument(); |
1188 } | 1189 } |
1189 | 1190 |
1190 void RenderFrameHostImpl::OnDidDisownOpener() { | 1191 void RenderFrameHostImpl::OnDidDisownOpener() { |
1191 // This message is only sent for top-level frames. TODO(avi): when frame tree | 1192 // This message is only sent for top-level frames. TODO(avi): when frame tree |
1192 // mirroring works correctly, add a check here to enforce it. | 1193 // mirroring works correctly, add a check here to enforce it. |
1193 delegate_->DidDisownOpener(this); | 1194 delegate_->DidDisownOpener(this); |
1194 } | 1195 } |
1195 | 1196 |
| 1197 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { |
| 1198 frame_tree_node()->SetFrameName(name); |
| 1199 delegate_->DidChangeName(this, name); |
| 1200 } |
| 1201 |
1196 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { | 1202 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { |
1197 // Update the RVH's current page ID so that future IPCs from the renderer | 1203 // Update the RVH's current page ID so that future IPCs from the renderer |
1198 // correspond to the new page. | 1204 // correspond to the new page. |
1199 render_view_host_->page_id_ = page_id; | 1205 render_view_host_->page_id_ = page_id; |
1200 } | 1206 } |
1201 | 1207 |
1202 void RenderFrameHostImpl::OnDidChangeSandboxFlags(int32 frame_routing_id, | 1208 void RenderFrameHostImpl::OnDidChangeSandboxFlags(int32 frame_routing_id, |
1203 SandboxFlags flags) { | 1209 SandboxFlags flags) { |
1204 FrameTree* frame_tree = frame_tree_node()->frame_tree(); | 1210 FrameTree* frame_tree = frame_tree_node()->frame_tree(); |
1205 FrameTreeNode* child = | 1211 FrameTreeNode* child = |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1952 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1958 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
1953 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1959 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
1954 GetContentClient()->browser()->RegisterPermissionUsage( | 1960 GetContentClient()->browser()->RegisterPermissionUsage( |
1955 PERMISSION_GEOLOCATION, | 1961 PERMISSION_GEOLOCATION, |
1956 delegate_->GetAsWebContents(), | 1962 delegate_->GetAsWebContents(), |
1957 GetLastCommittedURL().GetOrigin(), | 1963 GetLastCommittedURL().GetOrigin(), |
1958 top_frame->GetLastCommittedURL().GetOrigin()); | 1964 top_frame->GetLastCommittedURL().GetOrigin()); |
1959 } | 1965 } |
1960 | 1966 |
1961 } // namespace content | 1967 } // namespace content |
OLD | NEW |