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_UpdateTitle, OnUpdateTitle) | 374 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) |
374 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) | 375 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) |
375 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, | 376 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, |
376 OnBeginNavigation) | 377 OnBeginNavigation) |
377 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad) | 378 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad) |
378 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, | 379 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, |
379 OnTextSurroundingSelectionResponse) | 380 OnTextSurroundingSelectionResponse) |
380 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) | 381 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) |
381 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, | 382 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1181 void RenderFrameHostImpl::OnDidAccessInitialDocument() { | 1182 void RenderFrameHostImpl::OnDidAccessInitialDocument() { |
1182 delegate_->DidAccessInitialDocument(); | 1183 delegate_->DidAccessInitialDocument(); |
1183 } | 1184 } |
1184 | 1185 |
1185 void RenderFrameHostImpl::OnDidDisownOpener() { | 1186 void RenderFrameHostImpl::OnDidDisownOpener() { |
1186 // This message is only sent for top-level frames. TODO(avi): when frame tree | 1187 // This message is only sent for top-level frames. TODO(avi): when frame tree |
1187 // mirroring works correctly, add a check here to enforce it. | 1188 // mirroring works correctly, add a check here to enforce it. |
1188 delegate_->DidDisownOpener(this); | 1189 delegate_->DidDisownOpener(this); |
1189 } | 1190 } |
1190 | 1191 |
1192 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { | |
1193 // Update the frame's name in the browser process | |
nasko
2015/03/05 18:09:27
nit: Comments that explain what the code does when
alexmos
2015/03/09 18:47:58
Done.
| |
1194 frame_tree_node()->set_frame_name(name); | |
1195 | |
1196 // Notify this frame's proxies about the updated name. | |
1197 frame_tree_node()->render_manager()->OnDidUpdateName(name); | |
nasko
2015/03/05 18:09:27
Shouldn't we put this code inside the FTN's method
alexmos
2015/03/09 18:47:58
Great point - done. Renamed FrameTreeNode::set_fr
| |
1198 } | |
1199 | |
1191 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { | 1200 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { |
1192 // Update the RVH's current page ID so that future IPCs from the renderer | 1201 // Update the RVH's current page ID so that future IPCs from the renderer |
1193 // correspond to the new page. | 1202 // correspond to the new page. |
1194 render_view_host_->page_id_ = page_id; | 1203 render_view_host_->page_id_ = page_id; |
1195 } | 1204 } |
1196 | 1205 |
1197 void RenderFrameHostImpl::OnUpdateTitle( | 1206 void RenderFrameHostImpl::OnUpdateTitle( |
1198 const base::string16& title, | 1207 const base::string16& title, |
1199 blink::WebTextDirection title_direction) { | 1208 blink::WebTextDirection title_direction) { |
1200 // This message is only sent for top-level frames. TODO(avi): when frame tree | 1209 // This message is only sent for top-level frames. TODO(avi): when frame tree |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1915 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1924 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
1916 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1925 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
1917 GetContentClient()->browser()->RegisterPermissionUsage( | 1926 GetContentClient()->browser()->RegisterPermissionUsage( |
1918 PERMISSION_GEOLOCATION, | 1927 PERMISSION_GEOLOCATION, |
1919 delegate_->GetAsWebContents(), | 1928 delegate_->GetAsWebContents(), |
1920 GetLastCommittedURL().GetOrigin(), | 1929 GetLastCommittedURL().GetOrigin(), |
1921 top_frame->GetLastCommittedURL().GetOrigin()); | 1930 top_frame->GetLastCommittedURL().GetOrigin()); |
1922 } | 1931 } |
1923 | 1932 |
1924 } // namespace content | 1933 } // namespace content |
OLD | NEW |