| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 | 340 |
| 341 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( | 341 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( |
| 342 const GURL& url, | 342 const GURL& url, |
| 343 bool has_user_gesture) { | 343 bool has_user_gesture) { |
| 344 // Since this is renderer-initiated navigation, the RenderFrame must be | 344 // Since this is renderer-initiated navigation, the RenderFrame must be |
| 345 // initialized. Do it if it hasn't happened yet. | 345 // initialized. Do it if it hasn't happened yet. |
| 346 InitializeRenderFrameIfNeeded(); | 346 InitializeRenderFrameIfNeeded(); |
| 347 | 347 |
| 348 if (IsBrowserSideNavigationEnabled()) { | 348 if (IsBrowserSideNavigationEnabled()) { |
| 349 BeginNavigationParams begin_params("GET", std::string(), net::LOAD_NORMAL, | 349 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, |
| 350 has_user_gesture, false, | 350 has_user_gesture, false, |
| 351 REQUEST_CONTEXT_TYPE_HYPERLINK); | 351 REQUEST_CONTEXT_TYPE_HYPERLINK); |
| 352 CommonNavigationParams common_params; | 352 CommonNavigationParams common_params; |
| 353 common_params.url = url; | 353 common_params.url = url; |
| 354 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); | 354 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); |
| 355 common_params.transition = ui::PAGE_TRANSITION_LINK; | 355 common_params.transition = ui::PAGE_TRANSITION_LINK; |
| 356 OnBeginNavigation(common_params, begin_params, | 356 OnBeginNavigation(common_params, begin_params, |
| 357 scoped_refptr<ResourceRequestBody>()); | 357 scoped_refptr<ResourceRequestBody>()); |
| 358 } | 358 } |
| 359 } | 359 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 // cleared during DidFailProvisionalLoad). | 416 // cleared during DidFailProvisionalLoad). |
| 417 int page_id = entry ? entry->GetPageID() : -1; | 417 int page_id = entry ? entry->GetPageID() : -1; |
| 418 if (page_id == -1) { | 418 if (page_id == -1) { |
| 419 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 419 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
| 420 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 420 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
| 421 } | 421 } |
| 422 return page_id; | 422 return page_id; |
| 423 } | 423 } |
| 424 | 424 |
| 425 } // namespace content | 425 } // namespace content |
| OLD | NEW |