Chromium Code Reviews| 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1002 IPC_MESSAGE_HANDLER(FrameMsg_ShowTransitionElements, | 1002 IPC_MESSAGE_HANDLER(FrameMsg_ShowTransitionElements, |
| 1003 OnShowTransitionElements) | 1003 OnShowTransitionElements) |
| 1004 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 1004 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
| 1005 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 1005 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
| 1006 OnTextSurroundingSelectionRequest) | 1006 OnTextSurroundingSelectionRequest) |
| 1007 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, | 1007 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, |
| 1008 OnAddStyleSheetByURL) | 1008 OnAddStyleSheetByURL) |
| 1009 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 1009 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
| 1010 OnSetAccessibilityMode) | 1010 OnSetAccessibilityMode) |
| 1011 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) | 1011 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) |
| 1012 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) | |
| 1012 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | 1013 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
| 1013 #if defined(OS_ANDROID) | 1014 #if defined(OS_ANDROID) |
| 1014 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1015 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
| 1015 #elif defined(OS_MACOSX) | 1016 #elif defined(OS_MACOSX) |
| 1016 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 1017 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
| 1017 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) | 1018 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) |
| 1018 #endif | 1019 #endif |
| 1019 IPC_END_MESSAGE_MAP() | 1020 IPC_END_MESSAGE_MAP() |
| 1020 | 1021 |
| 1021 return handled; | 1022 return handled; |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1541 void RenderFrameImpl::OnDisownOpener() { | 1542 void RenderFrameImpl::OnDisownOpener() { |
| 1542 // TODO(creis): We should only see this for main frames for now. To support | 1543 // TODO(creis): We should only see this for main frames for now. To support |
| 1543 // disowning the opener on subframes, we will need to move WebContentsImpl's | 1544 // disowning the opener on subframes, we will need to move WebContentsImpl's |
| 1544 // opener_ to FrameTreeNode. | 1545 // opener_ to FrameTreeNode. |
| 1545 CHECK(!frame_->parent()); | 1546 CHECK(!frame_->parent()); |
| 1546 | 1547 |
| 1547 if (frame_->opener()) | 1548 if (frame_->opener()) |
| 1548 frame_->setOpener(NULL); | 1549 frame_->setOpener(NULL); |
| 1549 } | 1550 } |
| 1550 | 1551 |
| 1552 void RenderFrameImpl::OnDispatchLoad(int subframe_routing_id) { | |
|
nasko
2015/02/24 22:47:11
nit: Shouldn't we call the parameter name "proxy_r
alexmos
2015/02/24 23:31:18
Routing through the proxy made this argument unnec
| |
| 1553 // The child frame should be a proxy in parent's process. | |
| 1554 RenderFrameProxy* subframe = | |
| 1555 RenderFrameProxy::FromRoutingID(subframe_routing_id); | |
| 1556 | |
| 1557 // Only dispatch the event if the proxy still exists. | |
| 1558 if (subframe) { | |
| 1559 CHECK(subframe->web_frame()->parent() == frame_); | |
| 1560 subframe->web_frame()->DispatchLoadEventForFrameOwner(); | |
| 1561 } | |
| 1562 } | |
| 1563 | |
| 1551 #if defined(OS_ANDROID) | 1564 #if defined(OS_ANDROID) |
| 1552 void RenderFrameImpl::OnSelectPopupMenuItems( | 1565 void RenderFrameImpl::OnSelectPopupMenuItems( |
| 1553 bool canceled, | 1566 bool canceled, |
| 1554 const std::vector<int>& selected_indices) { | 1567 const std::vector<int>& selected_indices) { |
| 1555 // It is possible to receive more than one of these calls if the user presses | 1568 // It is possible to receive more than one of these calls if the user presses |
| 1556 // a select faster than it takes for the show-select-popup IPC message to make | 1569 // a select faster than it takes for the show-select-popup IPC message to make |
| 1557 // it to the browser UI thread. Ignore the extra-messages. | 1570 // it to the browser UI thread. Ignore the extra-messages. |
| 1558 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. | 1571 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. |
| 1559 if (!external_popup_menu_) | 1572 if (!external_popup_menu_) |
| 1560 return; | 1573 return; |
| (...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2758 } | 2771 } |
| 2759 | 2772 |
| 2760 void RenderFrameImpl::didChangeThemeColor() { | 2773 void RenderFrameImpl::didChangeThemeColor() { |
| 2761 if (frame_->parent()) | 2774 if (frame_->parent()) |
| 2762 return; | 2775 return; |
| 2763 | 2776 |
| 2764 Send(new FrameHostMsg_DidChangeThemeColor( | 2777 Send(new FrameHostMsg_DidChangeThemeColor( |
| 2765 routing_id_, frame_->document().themeColor())); | 2778 routing_id_, frame_->document().themeColor())); |
| 2766 } | 2779 } |
| 2767 | 2780 |
| 2781 void RenderFrameImpl::dispatchLoad() { | |
| 2782 Send(new FrameHostMsg_DispatchLoad(routing_id_)); | |
| 2783 } | |
| 2784 | |
| 2768 void RenderFrameImpl::requestNotificationPermission( | 2785 void RenderFrameImpl::requestNotificationPermission( |
| 2769 const blink::WebSecurityOrigin& origin, | 2786 const blink::WebSecurityOrigin& origin, |
| 2770 blink::WebNotificationPermissionCallback* callback) { | 2787 blink::WebNotificationPermissionCallback* callback) { |
| 2771 if (!notification_permission_dispatcher_) { | 2788 if (!notification_permission_dispatcher_) { |
| 2772 notification_permission_dispatcher_ = | 2789 notification_permission_dispatcher_ = |
| 2773 new NotificationPermissionDispatcher(this); | 2790 new NotificationPermissionDispatcher(this); |
| 2774 } | 2791 } |
| 2775 | 2792 |
| 2776 notification_permission_dispatcher_->RequestPermission(origin, callback); | 2793 notification_permission_dispatcher_->RequestPermission(origin, callback); |
| 2777 } | 2794 } |
| (...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4442 | 4459 |
| 4443 #if defined(ENABLE_BROWSER_CDMS) | 4460 #if defined(ENABLE_BROWSER_CDMS) |
| 4444 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4461 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 4445 if (!cdm_manager_) | 4462 if (!cdm_manager_) |
| 4446 cdm_manager_ = new RendererCdmManager(this); | 4463 cdm_manager_ = new RendererCdmManager(this); |
| 4447 return cdm_manager_; | 4464 return cdm_manager_; |
| 4448 } | 4465 } |
| 4449 #endif // defined(ENABLE_BROWSER_CDMS) | 4466 #endif // defined(ENABLE_BROWSER_CDMS) |
| 4450 | 4467 |
| 4451 } // namespace content | 4468 } // namespace content |
| OLD | NEW |