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/test/test_render_frame_host.h" | 5 #include "content/test/test_render_frame_host.h" |
6 | 6 |
7 #include "content/browser/frame_host/frame_tree.h" | 7 #include "content/browser/frame_host/frame_tree.h" |
8 #include "content/browser/frame_host/navigation_handle_impl.h" | 8 #include "content/browser/frame_host/navigation_handle_impl.h" |
9 #include "content/browser/frame_host/navigation_request.h" | 9 #include "content/browser/frame_host/navigation_request.h" |
10 #include "content/browser/frame_host/navigator.h" | 10 #include "content/browser/frame_host/navigator.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 252 } |
253 | 253 |
254 void TestRenderFrameHost::SendNavigateWithParameters( | 254 void TestRenderFrameHost::SendNavigateWithParameters( |
255 int page_id, | 255 int page_id, |
256 int nav_entry_id, | 256 int nav_entry_id, |
257 bool did_create_new_entry, | 257 bool did_create_new_entry, |
258 const GURL& url, | 258 const GURL& url, |
259 ui::PageTransition transition, | 259 ui::PageTransition transition, |
260 int response_code, | 260 int response_code, |
261 const ModificationCallback& callback) { | 261 const ModificationCallback& callback) { |
| 262 if (!IsBrowserSideNavigationEnabled()) |
| 263 OnDidStartLoading(true); |
| 264 |
262 // DidStartProvisionalLoad may delete the pending entry that holds |url|, | 265 // DidStartProvisionalLoad may delete the pending entry that holds |url|, |
263 // so we keep a copy of it to use below. | 266 // so we keep a copy of it to use below. |
264 GURL url_copy(url); | 267 GURL url_copy(url); |
265 OnDidStartLoading(true); | |
266 OnDidStartProvisionalLoad(url_copy, base::TimeTicks::Now()); | 268 OnDidStartProvisionalLoad(url_copy, base::TimeTicks::Now()); |
267 | 269 |
268 FrameHostMsg_DidCommitProvisionalLoad_Params params; | 270 FrameHostMsg_DidCommitProvisionalLoad_Params params; |
269 params.page_id = page_id; | 271 params.page_id = page_id; |
270 params.nav_entry_id = nav_entry_id; | 272 params.nav_entry_id = nav_entry_id; |
271 params.url = url_copy; | 273 params.url = url_copy; |
272 params.transition = transition; | 274 params.transition = transition; |
273 params.should_update_history = true; | 275 params.should_update_history = true; |
274 params.did_create_new_entry = did_create_new_entry; | 276 params.did_create_new_entry = did_create_new_entry; |
275 params.gesture = NavigationGestureUser; | 277 params.gesture = NavigationGestureUser; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // cleared during DidFailProvisionalLoad). | 406 // cleared during DidFailProvisionalLoad). |
405 int page_id = entry ? entry->GetPageID() : -1; | 407 int page_id = entry ? entry->GetPageID() : -1; |
406 if (page_id == -1) { | 408 if (page_id == -1) { |
407 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 409 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
408 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 410 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
409 } | 411 } |
410 return page_id; | 412 return page_id; |
411 } | 413 } |
412 | 414 |
413 } // namespace content | 415 } // namespace content |
OLD | NEW |