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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 while ((observer = it.GetNext()) != NULL) { | 753 while ((observer = it.GetNext()) != NULL) { |
754 if (observer->OnMessageReceived(msg)) | 754 if (observer->OnMessageReceived(msg)) |
755 return true; | 755 return true; |
756 } | 756 } |
757 | 757 |
758 bool handled = true; | 758 bool handled = true; |
759 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) | 759 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) |
760 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) | 760 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) |
761 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) | 761 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) |
762 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) | 762 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) |
| 763 IPC_MESSAGE_HANDLER(FrameMsg_NewWidgetForFrame, OnNewWidgetForFrame) |
763 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop) | 764 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop) |
764 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) | 765 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) |
765 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, | 766 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, |
766 OnCustomContextMenuAction) | 767 OnCustomContextMenuAction) |
767 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo) | 768 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo) |
768 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo) | 769 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo) |
769 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut) | 770 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut) |
770 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy) | 771 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy) |
771 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste) | 772 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste) |
772 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) | 773 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 } else { | 1108 } else { |
1108 set_render_frame_proxy(proxy); | 1109 set_render_frame_proxy(proxy); |
1109 } | 1110 } |
1110 } | 1111 } |
1111 | 1112 |
1112 // Safe to exit if no one else is using the process. | 1113 // Safe to exit if no one else is using the process. |
1113 if (is_main_frame) | 1114 if (is_main_frame) |
1114 render_view_->WasSwappedOut(); | 1115 render_view_->WasSwappedOut(); |
1115 } | 1116 } |
1116 | 1117 |
| 1118 void RenderFrameImpl::OnNewWidgetForFrame(int routing_id_for_widget, |
| 1119 bool hidden) { |
| 1120 render_widget_ = RenderWidget::CreateForFrame( |
| 1121 routing_id_for_widget, |
| 1122 hidden, |
| 1123 render_view_->screen_info()); |
| 1124 } |
| 1125 |
1117 void RenderFrameImpl::OnContextMenuClosed( | 1126 void RenderFrameImpl::OnContextMenuClosed( |
1118 const CustomContextMenuContext& custom_context) { | 1127 const CustomContextMenuContext& custom_context) { |
1119 if (custom_context.request_id) { | 1128 if (custom_context.request_id) { |
1120 // External request, should be in our map. | 1129 // External request, should be in our map. |
1121 ContextMenuClient* client = | 1130 ContextMenuClient* client = |
1122 pending_context_menus_.Lookup(custom_context.request_id); | 1131 pending_context_menus_.Lookup(custom_context.request_id); |
1123 if (client) { | 1132 if (client) { |
1124 client->OnMenuClosed(custom_context.request_id); | 1133 client->OnMenuClosed(custom_context.request_id); |
1125 pending_context_menus_.Remove(custom_context.request_id); | 1134 pending_context_menus_.Remove(custom_context.request_id); |
1126 } | 1135 } |
(...skipping 2779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3906 | 3915 |
3907 #if defined(ENABLE_BROWSER_CDMS) | 3916 #if defined(ENABLE_BROWSER_CDMS) |
3908 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3917 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3909 if (!cdm_manager_) | 3918 if (!cdm_manager_) |
3910 cdm_manager_ = new RendererCdmManager(this); | 3919 cdm_manager_ = new RendererCdmManager(this); |
3911 return cdm_manager_; | 3920 return cdm_manager_; |
3912 } | 3921 } |
3913 #endif // defined(ENABLE_BROWSER_CDMS) | 3922 #endif // defined(ENABLE_BROWSER_CDMS) |
3914 | 3923 |
3915 } // namespace content | 3924 } // namespace content |
OLD | NEW |