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 "base/run_loop.h" | 8 #include "base/run_loop.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/navigation_handle_impl.h" | 10 #include "content/browser/frame_host/navigation_handle_impl.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 } | 402 } |
403 | 403 |
404 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( | 404 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( |
405 const GURL& url, | 405 const GURL& url, |
406 bool has_user_gesture) { | 406 bool has_user_gesture) { |
407 // Since this is renderer-initiated navigation, the RenderFrame must be | 407 // Since this is renderer-initiated navigation, the RenderFrame must be |
408 // initialized. Do it if it hasn't happened yet. | 408 // initialized. Do it if it hasn't happened yet. |
409 InitializeRenderFrameIfNeeded(); | 409 InitializeRenderFrameIfNeeded(); |
410 | 410 |
411 if (IsBrowserSideNavigationEnabled()) { | 411 if (IsBrowserSideNavigationEnabled()) { |
412 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, | 412 // TODO(mkwst): The initiator origin here is incorrect. |
413 has_user_gesture, false, | 413 BeginNavigationParams begin_params( |
414 REQUEST_CONTEXT_TYPE_HYPERLINK); | 414 std::string(), net::LOAD_NORMAL, has_user_gesture, false, |
| 415 REQUEST_CONTEXT_TYPE_HYPERLINK, url::Origin()); |
415 CommonNavigationParams common_params; | 416 CommonNavigationParams common_params; |
416 common_params.url = url; | 417 common_params.url = url; |
417 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); | 418 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); |
418 common_params.transition = ui::PAGE_TRANSITION_LINK; | 419 common_params.transition = ui::PAGE_TRANSITION_LINK; |
419 OnBeginNavigation(common_params, begin_params); | 420 OnBeginNavigation(common_params, begin_params); |
420 } | 421 } |
421 } | 422 } |
422 | 423 |
423 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { | 424 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { |
424 OnDidChangeOpener(opener_routing_id); | 425 OnDidChangeOpener(opener_routing_id); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at | 503 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at |
503 // this point. | 504 // this point. |
504 if (!navigation_handle() || IsBrowserSideNavigationEnabled()) | 505 if (!navigation_handle() || IsBrowserSideNavigationEnabled()) |
505 return; | 506 return; |
506 navigation_handle()->CallWillStartRequestForTesting( | 507 navigation_handle()->CallWillStartRequestForTesting( |
507 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), | 508 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), |
508 true /* user_gesture */, transition, false /* is_external_protocol */); | 509 true /* user_gesture */, transition, false /* is_external_protocol */); |
509 } | 510 } |
510 | 511 |
511 } // namespace content | 512 } // namespace content |
OLD | NEW |