Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1596)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 616133002: Make RenderFrame(Host) own a RenderWidget(Host). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 } else { 1104 } else {
1104 set_render_frame_proxy(proxy); 1105 set_render_frame_proxy(proxy);
1105 } 1106 }
1106 } 1107 }
1107 1108
1108 // Safe to exit if no one else is using the process. 1109 // Safe to exit if no one else is using the process.
1109 if (is_main_frame) 1110 if (is_main_frame)
1110 render_view_->WasSwappedOut(); 1111 render_view_->WasSwappedOut();
1111 } 1112 }
1112 1113
1114 void RenderFrameImpl::OnNewWidgetForFrame(int routing_id_for_widget,
1115 bool hidden) {
1116 render_widget_ = RenderWidget::CreateForFrame(
1117 routing_id_for_widget,
1118 hidden,
1119 render_view_->screen_info());
1120 }
1121
1113 void RenderFrameImpl::OnContextMenuClosed( 1122 void RenderFrameImpl::OnContextMenuClosed(
1114 const CustomContextMenuContext& custom_context) { 1123 const CustomContextMenuContext& custom_context) {
1115 if (custom_context.request_id) { 1124 if (custom_context.request_id) {
1116 // External request, should be in our map. 1125 // External request, should be in our map.
1117 ContextMenuClient* client = 1126 ContextMenuClient* client =
1118 pending_context_menus_.Lookup(custom_context.request_id); 1127 pending_context_menus_.Lookup(custom_context.request_id);
1119 if (client) { 1128 if (client) {
1120 client->OnMenuClosed(custom_context.request_id); 1129 client->OnMenuClosed(custom_context.request_id);
1121 pending_context_menus_.Remove(custom_context.request_id); 1130 pending_context_menus_.Remove(custom_context.request_id);
1122 } 1131 }
(...skipping 2791 matching lines...) Expand 10 before | Expand all | Expand 10 after
3914 3923
3915 #if defined(ENABLE_BROWSER_CDMS) 3924 #if defined(ENABLE_BROWSER_CDMS)
3916 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 3925 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
3917 if (!cdm_manager_) 3926 if (!cdm_manager_)
3918 cdm_manager_ = new RendererCdmManager(this); 3927 cdm_manager_ = new RendererCdmManager(this);
3919 return cdm_manager_; 3928 return cdm_manager_;
3920 } 3929 }
3921 #endif // defined(ENABLE_BROWSER_CDMS) 3930 #endif // defined(ENABLE_BROWSER_CDMS)
3922 3931
3923 } // namespace content 3932 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698