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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 157713002: Switch DomAutomationController to be a RenderFrameObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add notification to interstitialpageimpl Created 6 years, 10 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 | Annotate | Revision Log
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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "content/browser/frame_host/cross_process_frame_connector.h" 9 #include "content/browser/frame_host/cross_process_frame_connector.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
11 #include "content/browser/frame_host/frame_tree_node.h" 11 #include "content/browser/frame_host/frame_tree_node.h"
12 #include "content/browser/frame_host/navigator.h" 12 #include "content/browser/frame_host/navigator.h"
13 #include "content/browser/frame_host/render_frame_host_delegate.h" 13 #include "content/browser/frame_host/render_frame_host_delegate.h"
14 #include "content/browser/renderer_host/render_view_host_impl.h" 14 #include "content/browser/renderer_host/render_view_host_impl.h"
15 #include "content/common/frame_messages.h" 15 #include "content/common/frame_messages.h"
16 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
17 #include "content/public/browser/dom_operation_notification_details.h"
17 #include "content/public/browser/render_process_host.h" 18 #include "content/public/browser/render_process_host.h"
18 #include "content/public/browser/render_widget_host_view.h" 19 #include "content/public/browser/render_widget_host_view.h"
19 #include "content/public/browser/user_metrics.h" 20 #include "content/public/browser/user_metrics.h"
20 #include "url/gurl.h" 21 #include "url/gurl.h"
21 22
22 namespace content { 23 namespace content {
23 24
24 // The (process id, routing id) pair that identifies one RenderFrame. 25 // The (process id, routing id) pair that identifies one RenderFrame.
25 typedef std::pair<int32, int32> RenderFrameHostID; 26 typedef std::pair<int32, int32> RenderFrameHostID;
26 typedef base::hash_map<RenderFrameHostID, RenderFrameHostImpl*> 27 typedef base::hash_map<RenderFrameHostID, RenderFrameHostImpl*>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame, 131 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame,
131 OnDidStartProvisionalLoadForFrame) 132 OnDidStartProvisionalLoadForFrame)
132 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, 133 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError,
133 OnDidFailProvisionalLoadWithError) 134 OnDidFailProvisionalLoadWithError)
134 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRedirectProvisionalLoad, 135 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRedirectProvisionalLoad,
135 OnDidRedirectProvisionalLoad) 136 OnDidRedirectProvisionalLoad)
136 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, 137 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError,
137 OnDidFailLoadWithError) 138 OnDidFailLoadWithError)
138 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) 139 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK)
139 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) 140 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu)
141 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse,
142 OnDomOperationResponse)
140 IPC_END_MESSAGE_MAP_EX() 143 IPC_END_MESSAGE_MAP_EX()
141 144
142 if (!msg_is_ok) { 145 if (!msg_is_ok) {
143 // The message had a handler, but its de-serialization failed. 146 // The message had a handler, but its de-serialization failed.
144 // Kill the renderer. 147 // Kill the renderer.
145 RecordAction(base::UserMetricsAction("BadMessageTerminate_RFH")); 148 RecordAction(base::UserMetricsAction("BadMessageTerminate_RFH"));
146 GetProcess()->ReceivedBadMessage(); 149 GetProcess()->ReceivedBadMessage();
147 } 150 }
148 151
149 return handled; 152 return handled;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // We don't validate |unfiltered_link_url| so that this field can be used 233 // We don't validate |unfiltered_link_url| so that this field can be used
231 // when users want to copy the original link URL. 234 // when users want to copy the original link URL.
232 process->FilterURL(true, &validated_params.link_url); 235 process->FilterURL(true, &validated_params.link_url);
233 process->FilterURL(true, &validated_params.src_url); 236 process->FilterURL(true, &validated_params.src_url);
234 process->FilterURL(false, &validated_params.page_url); 237 process->FilterURL(false, &validated_params.page_url);
235 process->FilterURL(true, &validated_params.frame_url); 238 process->FilterURL(true, &validated_params.frame_url);
236 239
237 delegate_->ShowContextMenu(this, validated_params); 240 delegate_->ShowContextMenu(this, validated_params);
238 } 241 }
239 242
243 void RenderFrameHostImpl::OnDomOperationResponse(const std::string& json_string,
244 int automation_id) {
245 delegate_->OnDomOperationResponse(
246 DomOperationNotificationDetails(json_string, automation_id));
247 }
248
240 void RenderFrameHostImpl::SetPendingShutdown(const base::Closure& on_swap_out) { 249 void RenderFrameHostImpl::SetPendingShutdown(const base::Closure& on_swap_out) {
241 render_view_host_->SetPendingShutdown(on_swap_out); 250 render_view_host_->SetPendingShutdown(on_swap_out);
242 } 251 }
243 252
244 } // namespace content 253 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698