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 "base/guid.h" | 7 #include "base/guid.h" |
8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
9 #include "content/browser/frame_host/navigation_handle_impl.h" | 9 #include "content/browser/frame_host/navigation_handle_impl.h" |
10 #include "content/browser/frame_host/navigation_request.h" | 10 #include "content/browser/frame_host/navigation_request.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 | 265 |
266 void TestRenderFrameHost::SendNavigateWithParameters( | 266 void TestRenderFrameHost::SendNavigateWithParameters( |
267 int page_id, | 267 int page_id, |
268 int nav_entry_id, | 268 int nav_entry_id, |
269 bool did_create_new_entry, | 269 bool did_create_new_entry, |
270 const GURL& url, | 270 const GURL& url, |
271 ui::PageTransition transition, | 271 ui::PageTransition transition, |
272 int response_code, | 272 int response_code, |
273 const ModificationCallback& callback) { | 273 const ModificationCallback& callback) { |
| 274 if (!IsBrowserSideNavigationEnabled()) |
| 275 OnDidStartLoading(true); |
| 276 |
274 // DidStartProvisionalLoad may delete the pending entry that holds |url|, | 277 // DidStartProvisionalLoad may delete the pending entry that holds |url|, |
275 // so we keep a copy of it to use below. | 278 // so we keep a copy of it to use below. |
276 GURL url_copy(url); | 279 GURL url_copy(url); |
277 OnDidStartLoading(true); | |
278 OnDidStartProvisionalLoad(url_copy, base::TimeTicks::Now()); | 280 OnDidStartProvisionalLoad(url_copy, base::TimeTicks::Now()); |
279 | 281 |
280 FrameHostMsg_DidCommitProvisionalLoad_Params params; | 282 FrameHostMsg_DidCommitProvisionalLoad_Params params; |
281 params.page_id = page_id; | 283 params.page_id = page_id; |
282 params.nav_entry_id = nav_entry_id; | 284 params.nav_entry_id = nav_entry_id; |
283 params.url = url_copy; | 285 params.url = url_copy; |
284 params.transition = transition; | 286 params.transition = transition; |
285 params.should_update_history = true; | 287 params.should_update_history = true; |
286 params.did_create_new_entry = did_create_new_entry; | 288 params.did_create_new_entry = did_create_new_entry; |
287 params.gesture = NavigationGestureUser; | 289 params.gesture = NavigationGestureUser; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 // cleared during DidFailProvisionalLoad). | 418 // cleared during DidFailProvisionalLoad). |
417 int page_id = entry ? entry->GetPageID() : -1; | 419 int page_id = entry ? entry->GetPageID() : -1; |
418 if (page_id == -1) { | 420 if (page_id == -1) { |
419 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 421 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
420 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 422 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
421 } | 423 } |
422 return page_id; | 424 return page_id; |
423 } | 425 } |
424 | 426 |
425 } // namespace content | 427 } // namespace content |
OLD | NEW |