Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_proxy_host.h" | 5 #include "content/browser/frame_host/render_frame_proxy_host.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "content/browser/frame_host/cross_process_frame_connector.h" | 8 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| 9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
| 10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 | 93 |
| 94 bool RenderFrameProxyHost::Send(IPC::Message *msg) { | 94 bool RenderFrameProxyHost::Send(IPC::Message *msg) { |
| 95 // TODO(nasko): For now, RenderFrameHost uses this object to send IPC messages | 95 // TODO(nasko): For now, RenderFrameHost uses this object to send IPC messages |
| 96 // while swapped out. This can be removed once we don't have a swapped out | 96 // while swapped out. This can be removed once we don't have a swapped out |
| 97 // state on RenderFrameHosts. See https://crbug.com/357747. | 97 // state on RenderFrameHosts. See https://crbug.com/357747. |
| 98 msg->set_routing_id(routing_id_); | 98 msg->set_routing_id(routing_id_); |
| 99 return GetProcess()->Send(msg); | 99 return GetProcess()->Send(msg); |
| 100 } | 100 } |
| 101 | 101 |
| 102 bool RenderFrameProxyHost::OnMessageReceived(const IPC::Message& msg) { | 102 bool RenderFrameProxyHost::OnMessageReceived(const IPC::Message& msg) { |
| 103 bool handled = true; | |
|
Charlie Reis
2014/09/18 20:22:27
Let's move this new block to the end of the method
Nate Chapin
2014/09/18 22:39:02
Done.
| |
| 104 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxyHost, msg) | |
| 105 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) | |
| 106 IPC_MESSAGE_UNHANDLED(handled = false) | |
| 107 IPC_END_MESSAGE_MAP() | |
| 108 if (handled) | |
| 109 return true; | |
| 110 | |
| 103 if (cross_process_frame_connector_.get() && | 111 if (cross_process_frame_connector_.get() && |
| 104 cross_process_frame_connector_->OnMessageReceived(msg)) | 112 cross_process_frame_connector_->OnMessageReceived(msg)) |
| 105 return true; | 113 return true; |
| 106 | 114 |
| 107 // TODO(nasko): This can be removed once we don't have a swapped out state on | 115 // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 108 // RenderFrameHosts. See https://crbug.com/357747. | 116 // RenderFrameHosts. See https://crbug.com/357747. |
| 109 if (render_frame_host_.get()) | 117 if (render_frame_host_.get()) |
| 110 return render_frame_host_->OnMessageReceived(msg); | 118 return render_frame_host_->OnMessageReceived(msg); |
| 111 | 119 |
| 112 return false; | 120 return false; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 136 ->GetRenderViewHost(site_instance_.get()) | 144 ->GetRenderViewHost(site_instance_.get()) |
| 137 ->GetRoutingID())); | 145 ->GetRoutingID())); |
| 138 | 146 |
| 139 return true; | 147 return true; |
| 140 } | 148 } |
| 141 | 149 |
| 142 void RenderFrameProxyHost::DisownOpener() { | 150 void RenderFrameProxyHost::DisownOpener() { |
| 143 Send(new FrameMsg_DisownOpener(GetRoutingID())); | 151 Send(new FrameMsg_DisownOpener(GetRoutingID())); |
| 144 } | 152 } |
| 145 | 153 |
| 154 void RenderFrameProxyHost::OnOpenURL( | |
| 155 const FrameHostMsg_OpenURL_Params& params) { | |
| 156 frame_tree_node_->current_frame_host()->OpenURL(params); | |
| 157 } | |
| 158 | |
| 146 } // namespace content | 159 } // namespace content |
| OLD | NEW |