OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 bool handled = true; | 1202 bool handled = true; |
1203 bool msg_is_ok = true; | 1203 bool msg_is_ok = true; |
1204 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHostImpl, msg, msg_is_ok) | 1204 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHostImpl, msg, msg_is_ok) |
1205 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView) | 1205 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView) |
1206 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) | 1206 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) |
1207 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget, | 1207 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget, |
1208 OnShowFullscreenWidget) | 1208 OnShowFullscreenWidget) |
1209 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) | 1209 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) |
1210 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) | 1210 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) |
1211 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderProcessGone, OnRenderProcessGone) | 1211 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderProcessGone, OnRenderProcessGone) |
1212 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, | |
1213 OnDidRedirectProvisionalLoad) | |
1214 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_FrameNavigate, OnNavigate(msg)) | 1212 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_FrameNavigate, OnNavigate(msg)) |
1215 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateState, OnUpdateState) | 1213 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateState, OnUpdateState) |
1216 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTitle, OnUpdateTitle) | 1214 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTitle, OnUpdateTitle) |
1217 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateEncoding, OnUpdateEncoding) | 1215 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateEncoding, OnUpdateEncoding) |
1218 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnUpdateTargetURL) | 1216 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnUpdateTargetURL) |
1219 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateInspectorSetting, | 1217 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateInspectorSetting, |
1220 OnUpdateInspectorSetting) | 1218 OnUpdateInspectorSetting) |
1221 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 1219 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
1222 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 1220 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
1223 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartLoading, OnDidStartLoading) | 1221 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartLoading, OnDidStartLoading) |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 } | 1417 } |
1420 | 1418 |
1421 void RenderViewHostImpl::OnDidStartProvisionalLoadForFrame( | 1419 void RenderViewHostImpl::OnDidStartProvisionalLoadForFrame( |
1422 int64 frame_id, | 1420 int64 frame_id, |
1423 int64 parent_frame_id, | 1421 int64 parent_frame_id, |
1424 bool is_main_frame, | 1422 bool is_main_frame, |
1425 const GURL& url) { | 1423 const GURL& url) { |
1426 NOTREACHED(); | 1424 NOTREACHED(); |
1427 } | 1425 } |
1428 | 1426 |
1429 void RenderViewHostImpl::OnDidRedirectProvisionalLoad( | |
1430 int32 page_id, | |
1431 const GURL& source_url, | |
1432 const GURL& target_url) { | |
1433 delegate_->DidRedirectProvisionalLoad( | |
1434 this, page_id, source_url, target_url); | |
1435 } | |
1436 | |
1437 // Called when the renderer navigates. For every frame loaded, we'll get this | 1427 // Called when the renderer navigates. For every frame loaded, we'll get this |
1438 // notification containing parameters identifying the navigation. | 1428 // notification containing parameters identifying the navigation. |
1439 // | 1429 // |
1440 // Subframes are identified by the page transition type. For subframes loaded | 1430 // Subframes are identified by the page transition type. For subframes loaded |
1441 // as part of a wider page load, the page_id will be the same as for the top | 1431 // as part of a wider page load, the page_id will be the same as for the top |
1442 // level frame. If the user explicitly requests a subframe navigation, we will | 1432 // level frame. If the user explicitly requests a subframe navigation, we will |
1443 // get a new page_id because we need to create a new navigation entry for that | 1433 // get a new page_id because we need to create a new navigation entry for that |
1444 // action. | 1434 // action. |
1445 void RenderViewHostImpl::OnNavigate(const IPC::Message& msg) { | 1435 void RenderViewHostImpl::OnNavigate(const IPC::Message& msg) { |
1446 // Read the parameters out of the IPC message directly to avoid making another | 1436 // Read the parameters out of the IPC message directly to avoid making another |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2269 void RenderViewHostImpl::AttachToFrameTree() { | 2259 void RenderViewHostImpl::AttachToFrameTree() { |
2270 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2260 FrameTree* frame_tree = delegate_->GetFrameTree(); |
2271 | 2261 |
2272 frame_tree->ResetForMainFrameSwap(); | 2262 frame_tree->ResetForMainFrameSwap(); |
2273 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2263 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
2274 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2264 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
2275 } | 2265 } |
2276 } | 2266 } |
2277 | 2267 |
2278 } // namespace content | 2268 } // namespace content |
OLD | NEW |